mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 15:12:18 +00:00
1484d8251b
Build now puts dev files in `build` folder instead, which is excluded from npm.
49 lines
1 KiB
JavaScript
49 lines
1 KiB
JavaScript
'use strict';
|
|
|
|
const webpack = require('webpack');
|
|
const WebpackShellPlugin = require('webpack-shell-plugin');
|
|
|
|
module.exports = {
|
|
|
|
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,
|
|
},
|
|
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: [ /\.vert$/, /\.frag$/ ],
|
|
use: 'raw-loader'
|
|
}
|
|
]
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
|
'CANVAS_RENDERER': JSON.stringify(true),
|
|
'WEBGL_RENDERER': JSON.stringify(true)
|
|
}),
|
|
|
|
new WebpackShellPlugin({
|
|
onBuildEnd: 'node copy-to-examples.js'
|
|
})
|
|
|
|
],
|
|
|
|
devtool: 'source-map'
|
|
|
|
};
|