phaser/webpack.fb.dist.config.js

54 lines
1.4 KiB
JavaScript
Raw Normal View History

2018-08-23 17:10:46 +00:00
'use strict';
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
mode: 'production',
context: `${__dirname}/src/`,
entry: {
2018-09-20 15:58:23 +00:00
'phaser-facebook-instant-games': './phaser.js',
'phaser-facebook-instant-games.min': './phaser.js'
2018-08-23 17:10:46 +00:00
},
output: {
path: `${__dirname}/dist/`,
filename: '[name].js',
2018-09-20 13:13:59 +00:00
library: 'Phaser',
libraryTarget: 'umd',
umdNamedDefine: true
2018-08-23 17:10:46 +00:00
},
performance: { hints: false },
optimization: {
minimizer: [
new UglifyJSPlugin({
include: /\.min\.js$/,
parallel: true,
sourceMap: false,
uglifyOptions: {
compress: true,
ie8: false,
ecma: 5,
output: {comments: false},
warnings: false
},
warningsFilter: () => false
})
]
},
plugins: [
2018-09-20 13:13:59 +00:00
new webpack.DefinePlugin({
"typeof CANVAS_RENDERER": JSON.stringify(true),
"typeof WEBGL_RENDERER": JSON.stringify(true),
"typeof EXPERIMENTAL": JSON.stringify(false),
"typeof PLUGIN_CAMERA3D": JSON.stringify(false),
"typeof PLUGIN_FBINSTANT": JSON.stringify(true)
})
2018-08-23 17:10:46 +00:00
]
};