Newer
Older
Steven Dale
committed
var webpack = require('webpack');
// Plugins
var CopyWebpackPlugin = require('copy-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
Steven Dale
committed
// PostCss
var autoprefixer = require('autoprefixer');
var postcssVars = require('postcss-simple-vars');
var postcssImport = require('postcss-import');
devServer: {
contentBase: path.resolve(__dirname, 'build'),
host: '0.0.0.0',
port: process.env.PORT || 8601
devtool: 'cheap-module-source-map',
blocksonly: './src/examples/blocks-only.jsx',
compatibilitytesting: './src/examples/compatibility-testing.jsx',
externals: {
React: 'react',
ReactDOM: 'react-dom'
},
localIdentName: '[name]_[local]_[hash:base64:5]',
camelCase: true
}
}, {
autoprefixer({
browsers: ['last 3 versions', 'Safari >= 8', 'iOS >= 8']
})
];
}
}
}]
test: /\.(svg|png|wav)$/,
'process.env.NODE_ENV': '"' + process.env.NODE_ENV + '"',
new HtmlWebpackPlugin({
chunks: ['lib', 'blocksonly'],
template: 'src/index.ejs',
filename: 'blocks-only.html',
title: 'Scratch 3.0 GUI: Blocks Only Example'
}),
new HtmlWebpackPlugin({
chunks: ['lib', 'compatibilitytesting'],
template: 'src/index.ejs',
filename: 'compatibility-testing.html',
title: 'Scratch 3.0 GUI: Compatibility Testing'
}),
new HtmlWebpackPlugin({
chunks: ['lib', 'player'],
template: 'src/index.ejs',
filename: 'player.html',
title: 'Scratch 3.0 GUI: Player Example'
}),
new CopyWebpackPlugin([{
from: 'static',
to: 'static'
}]),
new CopyWebpackPlugin([{
from: 'node_modules/scratch-blocks/media',
to: 'static/blocks-media'
from: 'extensions/**',
to: 'static',
context: 'src/examples'
from: 'extension-worker.{js,js.map}',
].concat(process.env.NODE_ENV === 'production' ? [
new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/,