-
-
Save Dogyunjeong/92bbcab81921ff274567ab997aefe5cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpack = require('webpack'); | |
var path = require('path'); | |
var fs = require('fs'); | |
var nodeModules = fs.readdirSync('node_modules') | |
.filter(function(x) { | |
return ['.bin'].indexOf(x) === -1; | |
}); | |
module.exports = { | |
entry: [ | |
'babel-polyfill', | |
'./server/app.js' | |
], | |
debug: true, | |
target: 'node', | |
output: { | |
filename: 'backend.js', | |
path: path.resolve(__dirname, 'server') | |
}, | |
node: { | |
__dirname: true, | |
__filename: true | |
}, | |
externals: [ | |
function(context, request, callback) { | |
var pathStart = request.split('/')[0]; | |
if (nodeModules.indexOf(pathStart) >= 0 && request != 'webpack/hot/signal.js') { | |
return callback(null, "commonjs " + request); | |
}; | |
callback(); | |
} | |
], | |
plugins: [ | |
new webpack.IgnorePlugin(/\.(css|less)$/), | |
new webpack.BannerPlugin('require("source-map-support").install();', | |
{ raw: true, entryOnly: false }), | |
new webpack.HotModuleReplacementPlugin({ quiet: true }) | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment