Last active
March 5, 2016 01:02
-
-
Save ryanflorence/23f01a0511cce34f7881 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 ExtractTextPlugin = require('extract-text-webpack-plugin') | |
var shared = require('./shared') | |
module.exports = { | |
devtool: 'inline-source-map', | |
entry: [ | |
'webpack-dev-server/client?http://localhost:3000', | |
'webpack/hot/only-dev-server', | |
shared.appEntry, | |
], | |
output: { | |
filename: 'app.js', | |
path: shared.buildDirectory, | |
publicPath: '/assets/', | |
}, | |
plugins: shared.plugins.concat([ | |
new webpack.HotModuleReplacementPlugin(), | |
new ExtractTextPlugin('style.less', { | |
allChunks: true, | |
}), | |
]), | |
resolve: shared.resolve, | |
module: { | |
loaders: shared.loaders.concat([ | |
{ test: /\.js$/, | |
loaders: [ 'react-hot', 'babel' ], | |
exclude: /node_modules/, | |
}, | |
{ test: /\.less$/, | |
loader: 'style!css?sourceMap!less?sourceMap', | |
}, | |
{ test: /\.css/, | |
loader: 'style!css?sourceMap', | |
}, | |
]), | |
}, | |
} |
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
module.exports = process.env.NODE_ENV === 'production' ? | |
require('./config.production'): | |
require('./config.development') | |
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 ExtractTextPlugin = require('extract-text-webpack-plugin') | |
var shared = require('./shared') | |
module.exports = { | |
devtool: 'source-map', | |
entry: { | |
app: shared.appEntry, | |
vendor: [ 'react', 'react-router' ], | |
}, | |
output: { | |
filename: '[name].js', | |
path: shared.buildDirectory, | |
publicPath: '/', | |
}, | |
plugins: shared.plugins.concat([ | |
new webpack.optimize.OccurenceOrderPlugin(), | |
new webpack.optimize.DedupePlugin(), | |
new webpack.optimize.UglifyJsPlugin({ | |
compressor: { warnings: false }, | |
}), | |
new ExtractTextPlugin('app.css', { | |
allChunks: true, | |
}), | |
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.bundle.js'), | |
]), | |
resolve: shared.resolve, | |
module: { | |
loaders: shared.loaders.concat([ | |
{ test: /\.js$/, | |
loaders: [ 'babel' ], | |
exclude: /node_modules/, | |
}, | |
{ test: /\.less$/, | |
loader: 'style!css!less', | |
}, | |
{ test: /\.css$/, | |
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!cssnext-loader'), | |
}, | |
{ test: /\.png$/, | |
loader: 'url-loader?mimetype=image/png', | |
}, | |
]), | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment