mirror of
https://github.com/photonstorm/phaser
synced 2024-11-14 00:47:29 +00:00
36 lines
933 B
JavaScript
36 lines
933 B
JavaScript
'use strict';
|
|
|
|
const webpack = require('webpack');
|
|
const WebpackShellPlugin = require('webpack-shell-plugin');
|
|
|
|
module.exports = {
|
|
mode: 'development',
|
|
|
|
context: `${__dirname}/src/`,
|
|
|
|
entry: {
|
|
phaser: './phaser.js'
|
|
},
|
|
|
|
output: {
|
|
path: `${__dirname}/build/`,
|
|
filename: '[name].js',
|
|
library: 'Phaser',
|
|
libraryTarget: 'umd',
|
|
sourceMapFilename: '[file].map',
|
|
devtoolModuleFilenameTemplate: 'webpack:///[resource-path]', // string
|
|
devtoolFallbackModuleFilenameTemplate: 'webpack:///[resource-path]?[hash]', // string
|
|
umdNamedDefine: true
|
|
},
|
|
|
|
plugins: [
|
|
new webpack.DefinePlugin({
|
|
"typeof CANVAS_RENDERER": JSON.stringify(true),
|
|
"typeof WEBGL_RENDERER": JSON.stringify(true)
|
|
}),
|
|
|
|
new WebpackShellPlugin({onBuildExit: 'node scripts/copy-to-examples.js'})
|
|
],
|
|
|
|
devtool: 'source-map'
|
|
};
|