-
-
Save Rojoss/0c0fb0d67d29b87fca93c3177ee12bfd 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 debug = process.env.NODE_ENV !== "production"; | |
var webpack = require('webpack'); | |
var path = require('path'); | |
module.exports = { | |
context: __dirname, | |
devtool: debug ? "inline-sourcemap" : null, | |
entry: { | |
"interface": "./src/interface/js/scripts.js", | |
"game": "./src/game/js/scripts.js", | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /\.jsx?$/, | |
exclude: /(node_modules|bower_components|game)/, | |
loader: 'babel-loader', | |
query: { | |
presets: ['react', 'es2015', 'stage-0'], | |
plugins: ['react-html-attrs', 'transform-decorators-legacy', 'transform-class-properties'], | |
} | |
}, | |
{ | |
test: /\.ts?$/, | |
exclude: /(node_modules|bower_components|interface)/, | |
loader: 'ts-loader?allowJsEntry=true', | |
} | |
] | |
}, | |
output: { | |
path: __dirname, | |
filename: "src/[name]/[name].min.js", | |
chunkFilename: "src/[name]/[name].min.js" | |
}, | |
plugins: debug ? [] : [ | |
new webpack.optimize.DedupePlugin(), | |
new webpack.optimize.OccurenceOrderPlugin(), | |
new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }), | |
], | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment