Skip to content

Instantly share code, notes, and snippets.

@Rojoss
Created March 8, 2017 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rojoss/0c0fb0d67d29b87fca93c3177ee12bfd to your computer and use it in GitHub Desktop.
Save Rojoss/0c0fb0d67d29b87fca93c3177ee12bfd to your computer and use it in GitHub Desktop.
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