Files
scratch-gui/webpack.config.js
T
Ray Schamp e43653a389 Add basic Stage component
Update webpack config and vm usage to match updates in scratch-vm
2016-09-22 10:23:44 -04:00

46 lines
1.1 KiB
JavaScript

var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var webpack = require('webpack');
module.exports = {
entry: {
vendor: ['react', 'react-dom'],
gui: './src/index.js'
},
output: {
path: path.resolve(__dirname, 'build'),
filename: '[name].js'
},
module: {
externals: {
React: 'react',
ReactDOM: 'react-dom'
},
loaders: [{
test: /\.js$/,
loader: 'babel-loader',
include: path.resolve(__dirname, 'src'),
query: {
presets: ['es2015', 'react']
}
}]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
filename: 'vendor.min.js'
})
].concat(process.env.NODE_ENV == 'production' ? [
new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/,
minimize: true,
compress: {
warnings: false
}
})
] : []).concat([
new HtmlWebpackPlugin({
title: 'Scratch 3.0 GUI'
})
])
};