Last active
December 6, 2017 06:56
-
-
Save abhirathore2006/8cf59c4c8b5900a4f6ad2c257ad024bf to your computer and use it in GitHub Desktop.
This file contains hidden or 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; | |
}) | |
.forEach(function(mod) { | |
nodeModules[mod] = 'commonjs ' + mod; | |
}); | |
module.exports = { | |
entry: './server-build/server/server.js', | |
target: 'node', | |
output: { | |
path: path.join(__dirname, '/../build'), | |
filename: 'backend.js' | |
}, | |
externals: nodeModules, | |
plugins: [ | |
new webpack.DefinePlugin({ | |
'process.env.NODE_ENV': JSON.stringify('production') | |
}), | |
new webpack.IgnorePlugin(/\.(css|less)$/), | |
new webpack.BannerPlugin({ | |
banner: 'require("source-map-support").install();', | |
raw: true, | |
entryOnly: false | |
}) | |
], | |
devtool: 'sourcemap' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment