2016-11-22 16:25:54 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const webpack = require('webpack');
|
2016-11-24 01:35:02 +00:00
|
|
|
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
|
|
|
|
2017-04-30 23:30:22 +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: {
|
2017-04-30 23:30:22 +00:00
|
|
|
path: `${__dirname}/dist/`,
|
2016-11-22 16:25:54 +00:00
|
|
|
filename: '[name].js',
|
2016-11-29 15:25:14 +00:00
|
|
|
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
|
|
|
},
|
|
|
|
|
2018-01-22 22:36:57 +00:00
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
2018-01-22 22:51:49 +00:00
|
|
|
test: [ /\.vert$/, /\.frag$/ ],
|
2018-01-22 22:36:57 +00:00
|
|
|
use: 'raw-loader'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
2016-11-24 01:35:02 +00:00
|
|
|
plugins: [
|
2016-11-22 16:25:54 +00:00
|
|
|
|
2017-09-13 14:27:43 +00:00
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'CANVAS_RENDERER': JSON.stringify(true),
|
|
|
|
'WEBGL_RENDERER': JSON.stringify(true)
|
|
|
|
}),
|
|
|
|
|
2016-11-24 01:35:02 +00:00
|
|
|
new WebpackShellPlugin({
|
2016-11-25 01:37:14 +00:00
|
|
|
onBuildStart: 'node create-checksum.js',
|
2016-11-24 01:35:02 +00:00
|
|
|
onBuildEnd: 'node copy-to-examples.js'
|
|
|
|
})
|
|
|
|
|
2016-11-29 15:25:14 +00:00
|
|
|
],
|
|
|
|
|
2017-07-31 13:23:28 +00:00
|
|
|
devtool: 'inline-source-map'
|
2016-11-25 01:37:14 +00:00
|
|
|
|
2016-11-22 03:32:41 +00:00
|
|
|
};
|