scratch-render/webpack.config.js
Christopher Willis-Ford 14b34f4b3c WIP pen layer
This is the absolute basics of a working pen layer. Still to do:
- Make it so that the pen layer can be in the drawables list so that it
  can be in front of the backdrop but behind other Drawables.
- Remove current debug canvas operations
- Add pen layer API
2016-12-15 13:35:37 -08:00

78 lines
1.8 KiB
JavaScript

const path = require('path');
const webpack = require('webpack');
const base = {
devServer: {
contentBase: path.resolve(__dirname, 'playground'),
host: '0.0.0.0',
watchOptions: {
aggregateTimeout: 300,
poll: 1000
},
stats: {
colors: true
}
},
devtool: 'source-map',
module: {
loaders: [
{
include: [
path.resolve(__dirname, 'src')
],
test: /\.js$/,
loader: 'babel-loader',
query: {
presets: ['es2015']
}
},
{
test: /\.json$/,
loader: 'json-loader'
},
{
test: /\.(glsl|vs|fs|frag|vert)$/,
loader: 'raw-loader'
}
]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/,
minimize: true,
compress: {
warnings: false
}
})
]
};
module.exports = [
// Web-compatible
Object.assign({}, base, {
target: 'web',
entry: {
'dist/web/scratch-render': './src/index-web.js',
'dist/web/scratch-render.min': './src/index-web.js',
'playground/scratch-render': './src/index-web.js'
},
output: {
path: __dirname,
filename: '[name].js'
}
}),
// Webpack-compatible
Object.assign({}, base, {
target: 'node',
entry: {
'scratch-render': './src/index.js'
},
output: {
library: 'ScratchRender',
libraryTarget: 'commonjs2',
path: __dirname,
filename: 'dist/node/[name].js'
}
})
];