mirror of
https://git.sindominio.net/estibadores/wordpress.git
synced 2024-11-14 23:21:07 +01:00
29 lines
588 B
JavaScript
29 lines
588 B
JavaScript
|
var webpack = require( 'webpack' ),
|
||
|
NODE_ENV = process.env.NODE_ENV || 'development',
|
||
|
webpackConfig = {
|
||
|
entry: './gutenberg/js/block.js',
|
||
|
output: {
|
||
|
path: __dirname,
|
||
|
filename: './gutenberg/js/block.build.js',
|
||
|
},
|
||
|
module: {
|
||
|
loaders: [
|
||
|
{
|
||
|
test: /.js$/,
|
||
|
loader: 'babel-loader',
|
||
|
exclude: /node_modules/,
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
plugins: [
|
||
|
new webpack.DefinePlugin( {
|
||
|
'process.env.NODE_ENV': JSON.stringify( NODE_ENV )
|
||
|
} ),
|
||
|
]
|
||
|
};
|
||
|
|
||
|
if ( 'production' === NODE_ENV ) {
|
||
|
webpackConfig.plugins.push( new webpack.optimize.UglifyJsPlugin() );
|
||
|
}
|
||
|
|
||
|
module.exports = webpackConfig;
|