phaser/webpack.config.js

50 lines
1 KiB
JavaScript
Raw Normal View History

2016-11-22 16:25:54 +00:00
'use strict';
const webpack = require('webpack');
const WebpackShellPlugin = require('webpack-shell-plugin');
2016-11-22 16:25:54 +00:00
2016-11-22 03:32:41 +00:00
module.exports = {
2016-11-22 16:25:54 +00:00
context: `${__dirname}/src/`,
2016-11-22 16:25:54 +00:00
entry: {
phaser: './phaser.js'
},
2016-11-22 03:32:41 +00:00
output: {
path: `${__dirname}/build/`,
2016-11-22 16:25:54 +00:00
filename: '[name].js',
library: 'Phaser',
libraryTarget: 'umd',
sourceMapFilename: '[file].map',
devtoolModuleFilenameTemplate: "webpack:///[resource-path]", // string
devtoolFallbackModuleFilenameTemplate: "webpack:///[resource-path]?[hash]", // string
umdNamedDefine: true,
2016-11-22 16:25:54 +00:00
},
module: {
rules: [
{
2018-01-22 22:51:49 +00:00
test: [ /\.vert$/, /\.frag$/ ],
use: 'raw-loader'
}
]
},
plugins: [
2016-11-22 16:25:54 +00:00
new webpack.DefinePlugin({
'CANVAS_RENDERER': JSON.stringify(true),
'WEBGL_RENDERER': JSON.stringify(true)
}),
new WebpackShellPlugin({
onBuildExit: 'node copy-to-examples.js'
})
],
2018-02-13 03:23:29 +00:00
devtool: 'source-map'
2016-11-22 03:32:41 +00:00
};