Created
April 1, 2016 18:55
-
-
Save jadbox/e1d6f409bac4162151f9a12090fdaa44 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 = { classnames: 'commonjs classnames', react: 'commonjs react' }; | |
fs.readdirSync('node_modules') | |
.filter(function(x) { | |
return ['.bin'].indexOf(x) === -1; | |
}) | |
.forEach(function(mod) { | |
nodeModules[mod] = 'commonjs ' + mod; | |
}); | |
module.exports = { | |
context: __dirname, | |
entry: { | |
"server-entry": path.join(__dirname, "index.js") | |
}, | |
target: 'node', | |
resolveLoader: { | |
modulesDirectories: [ | |
path.join(__dirname, "node_modules") | |
] | |
}, | |
module: { | |
loaders: [{ | |
test: /\.js$/, | |
include: [ | |
path.resolve(__dirname, "controllers") | |
], | |
exclude: /(node_modules|test|views)/, | |
loader: 'babel', | |
query: { | |
cacheDirectory: '/tmp', | |
presets: ['es2015'], | |
plugins: [ | |
"transform-function-bind" | |
] | |
} | |
}] | |
}, | |
output: { | |
filename: "[name].gen.js", | |
libraryTarget: "commonjs", | |
library: "", | |
path: path.resolve(__dirname) | |
}, | |
plugins: [ | |
], | |
externals: nodeModules, | |
devtool: 'eval', | |
debug: true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment