2018-08-23 17:10:46 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const webpack = require('webpack');
|
2021-09-21 13:41:11 +00:00
|
|
|
const TerserPlugin = require('terser-webpack-plugin');
|
2018-08-23 17:10:46 +00:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
mode: 'production',
|
|
|
|
|
2019-05-08 21:38:02 +00:00
|
|
|
context: `${__dirname}/../src/`,
|
2018-08-23 17:10:46 +00:00
|
|
|
|
|
|
|
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: {
|
2019-05-08 21:38:02 +00:00
|
|
|
path: `${__dirname}/../dist/`,
|
2018-08-23 17:10:46 +00:00
|
|
|
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: [
|
2021-09-21 13:41:11 +00:00
|
|
|
new TerserPlugin({
|
2018-08-23 17:10:46 +00:00
|
|
|
include: /\.min\.js$/,
|
|
|
|
parallel: true,
|
2021-09-21 13:41:11 +00:00
|
|
|
extractComments: false,
|
|
|
|
terserOptions: {
|
|
|
|
format: {
|
|
|
|
comments: false
|
|
|
|
},
|
2018-08-23 17:10:46 +00:00
|
|
|
compress: true,
|
|
|
|
ie8: false,
|
|
|
|
ecma: 5,
|
|
|
|
warnings: false
|
2021-09-21 13:41:11 +00:00
|
|
|
}
|
2018-08-23 17:10:46 +00:00
|
|
|
})
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
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),
|
2020-10-01 16:56:23 +00:00
|
|
|
"typeof PLUGIN_3D": JSON.stringify(false),
|
2018-09-20 13:13:59 +00:00
|
|
|
"typeof PLUGIN_CAMERA3D": JSON.stringify(false),
|
2019-04-24 11:23:21 +00:00
|
|
|
"typeof PLUGIN_FBINSTANT": JSON.stringify(true),
|
|
|
|
"typeof FEATURE_SOUND": JSON.stringify(true)
|
2018-09-20 13:13:59 +00:00
|
|
|
})
|
2018-08-23 17:10:46 +00:00
|
|
|
]
|
|
|
|
};
|