Last active
September 26, 2016 00:39
-
-
Save genomics-geek/df6814a09a61bfb6c66bbb5967623e53 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 path = require('path'); | |
var webpack = require('webpack'); | |
var BundleTracker = require('webpack-bundle-tracker') | |
module.exports = { | |
context: __dirname, | |
devtool: null, | |
entry: '../static/js/index', | |
output: {}, | |
plugins: [], | |
module: { | |
loaders: [] | |
}, | |
resolve: { | |
modulesDirectories: ['node_modules', 'bower_components'], | |
extensions: ['', '.js', '.jsx'] | |
} | |
}; |
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 path = require('path'); | |
var webpack = require('webpack'); | |
var BundleTracker = require('webpack-bundle-tracker') | |
var config = require('./webpack.base.config.js') | |
config.devtool = 'inline-sourcemap' | |
config.output.path = path.resolve('./static/builds-dev/'), | |
config.output.filename = '[name]-[hash].js' | |
config.output.publicPath = 'http://localhost:3000/static/builds/' | |
config.plugins = config.plugins.concat([ | |
new BundleTracker({filename: './webpack/webpack-stats.dev.json'}), | |
]) | |
config.module.loaders.push({ | |
test: /\.jsx?$/, | |
exclude: /(node_modules|bower_components)/, | |
loader: 'babel-loader', | |
query: { | |
presets: ['react', 'es2015'], | |
} | |
}) | |
module.exports = config |
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 path = require('path'); | |
var webpack = require('webpack'); | |
var BundleTracker = require('webpack-bundle-tracker') | |
var config = require('./webpack.base.config.js') | |
config.output.path = path.resolve('./static/builds') | |
config.output.filename = '[name]-[hash].min.js' | |
config.plugins = config.plugins.concat([ | |
new BundleTracker({filename: './webpack/webpack-stats.production.json'}), | |
new webpack.optimize.DedupePlugin(), | |
new webpack.optimize.OccurenceOrderPlugin(), | |
new webpack.optimize.UglifyJsPlugin({ | |
mangle: false, | |
sourcemap: false | |
}) | |
]) | |
module.exports = config |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment