41 Star 242 Fork 67

FreeCodeCamp / freecodecamp.cn

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
webpack.config.node.js 1.09 KB
一键复制 编辑 原始数据 按行查看 历史
var fs = require('fs');
var path = require('path');
var webpack = require('webpack');
var nodeModules = fs.readdirSync('node_modules')
.filter(function(x) {
return ['.bin'].indexOf(x) === -1;
})
.reduce(function(nodeModules, module) {
nodeModules[module] = 'commonjs ' + module;
return nodeModules;
}, {});
module.exports = {
devtool: 'sourcemap',
target: 'node',
entry: './common/app',
// keeps webpack from bundling modules
externals: nodeModules,
output: {
filename: 'app-stream.bundle.js',
path: path.join(__dirname, '/server'),
publicPath: 'public/'
},
module: {
loaders: [
{
test: /\.jsx?$/,
include: [
path.join(__dirname, 'client/'),
path.join(__dirname, 'common/')
],
loaders: [
'babel-loader'
]
},
{
test: /\.json$/,
loaders: [
'json-loader'
]
}
]
},
plugins: [
new webpack.BannerPlugin(
'require("source-map-support").install();',
{
raw: true,
entryOnly: false
}
)
]
};
JavaScript
1
https://gitee.com/freecodecamp/freecodecamp.cn.git
git@gitee.com:freecodecamp/freecodecamp.cn.git
freecodecamp
freecodecamp.cn
freecodecamp.cn
dev

搜索帮助