Skip to content

Instantly share code, notes, and snippets.

@nitaliano
Created April 6, 2016 19:44
Show Gist options
  • Save nitaliano/5eb6022bec590877235d60e50d47bb65 to your computer and use it in GitHub Desktop.
Save nitaliano/5eb6022bec590877235d60e50d47bb65 to your computer and use it in GitHub Desktop.
const config = {
entry: {
app: path.join(__dirname, 'src', 'app.jsx'),
},
devtool: IS_DEVELOP ? 'source-map' : 'hidden-source-map',
output: {
filename: '[name]' + (IS_DEVELOP ? '' : '.min') + '.js',
path: path.join(__dirname, 'build'),
publicPath: '/static/',
},
resolve: {
extensions: ['', '.js', '.jsx'],
},
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': IS_DEVELOP ? JSON.stringify('develop') : JSON.stringify('production'),
},
}),
],
module: {
loaders: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
{
test: /.json$/,
loader: 'json-loader',
},
{
test: /\.less$/,
loader: 'style?singleton!css!postcss!less',
},
{
test: /\.(png|jpg|jpeg|gif|svg|eot|ttf|otf|otf2|woff|woff2?)(\?\S*)?$/,
loader: 'url?limit=25000',
},
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment