mirror of
https://github.com/photonstorm/phaser
synced 2024-11-30 16:39:34 +00:00
dece45d731
- eslint: ^4.3.0 → ^4.13.1 - fs-extra: ^4.0.0 → ^5.0.0 - uglifyjs-webpack-plugin: ^0.4.6 → ^1.1.2 - webpack: ^3.4.1 → ^3.10.0
53 lines
1.2 KiB
JavaScript
53 lines
1.2 KiB
JavaScript
'use strict';
|
|
|
|
const webpack = require('webpack');
|
|
const WebpackShellPlugin = require('webpack-shell-plugin');
|
|
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
|
|
|
|
module.exports = {
|
|
|
|
context: `${__dirname}/src/`,
|
|
|
|
entry: {
|
|
phaser: './phaser.js',
|
|
'phaser.min': './phaser.js'
|
|
},
|
|
|
|
output: {
|
|
path: `${__dirname}/dist/`,
|
|
filename: '[name].js',
|
|
library: 'Phaser',
|
|
libraryTarget: 'umd',
|
|
umdNamedDefine: true
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
|
'CANVAS_RENDERER': JSON.stringify(true),
|
|
'WEBGL_RENDERER': JSON.stringify(true)
|
|
}),
|
|
|
|
new UglifyJSPlugin({
|
|
include: /\.min\.js$/,
|
|
parallel: true,
|
|
sourceMap: false,
|
|
uglifyOptions: {
|
|
compress: true,
|
|
ie8: false,
|
|
ecma: 5,
|
|
output: {
|
|
comments: false
|
|
},
|
|
warnings: false
|
|
},
|
|
warningsFilter: (src) => false
|
|
}),
|
|
|
|
new WebpackShellPlugin({
|
|
onBuildStart: 'node create-checksum.js'
|
|
})
|
|
|
|
]
|
|
|
|
};
|