wordpress/php-fpm/wordpress_files/plugins/pirate-forms/webpack.config.js

29 lines
588 B
JavaScript
Raw Permalink Normal View History

2020-05-22 03:40:23 +02:00
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;