-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated build scripts for webpack5 and Phaser 3.60
- Loading branch information
1 parent
8aed1e5
commit 3df1e34
Showing
10 changed files
with
2,481 additions
and
3,834 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/** | ||
* @author Richard Davey <[email protected]> | ||
* @copyright 2020 Photon Storm Ltd. | ||
* @copyright 2023 Photon Storm Ltd. | ||
* @license {@link https://opensource.org/licenses/MIT|MIT License} | ||
*/ | ||
|
||
|
@@ -25,6 +25,7 @@ var Phaser = { | |
Display: { Masks: require('display/mask') }, | ||
DOM: require('dom'), | ||
Events: require('events/EventEmitter'), | ||
FX: require('fx'), | ||
Game: require('core/Game'), | ||
GameObjects: { | ||
DisplayList: require('gameobjects/DisplayList'), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/** | ||
* @author Richard Davey <[email protected]> | ||
* @copyright 2020 Photon Storm Ltd. | ||
* @copyright 2023 Photon Storm Ltd. | ||
* @license {@link https://opensource.org/licenses/MIT|MIT License} | ||
*/ | ||
|
||
|
@@ -28,6 +28,7 @@ var Phaser = { | |
Display: require('display'), | ||
DOM: require('dom'), | ||
Events: require('events/index'), | ||
FX: require('fx'), | ||
Game: require('core/Game'), | ||
GameObjects: require('gameobjects'), | ||
Geom: require('geom'), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,70 @@ | ||
'use strict'; | ||
|
||
const webpack = require('webpack'); | ||
const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); | ||
const { CleanWebpackPlugin } = require('clean-webpack-plugin'); | ||
const path = require('path'); | ||
const { CleanWebpackPlugin } = require("clean-webpack-plugin"); | ||
const path = require("path"); | ||
const TerserPlugin = require("terser-webpack-plugin"); | ||
const webpack = require("webpack"); | ||
|
||
module.exports = { | ||
// mode: 'development', | ||
mode: "production", | ||
|
||
// mode: 'development', | ||
mode: 'production', | ||
|
||
entry: { | ||
'phaser-custom': `./phaser-custom.js`, | ||
'phaser-custom.min': './phaser-custom.js', | ||
'phaser-custom-sprite': `./phaser-custom-sprite.js`, | ||
'phaser-custom-sprite.min': './phaser-custom-sprite.js' | ||
}, | ||
|
||
resolve: { | ||
alias: { | ||
'eventemitter3': path.resolve(__dirname, './node_modules/eventemitter3') | ||
}, | ||
modules: [ 'node_modules/phaser/src' ] | ||
}, | ||
entry: { | ||
"phaser-custom": `./phaser-custom.js`, | ||
"phaser-custom.min": "./phaser-custom.js", | ||
"phaser-custom-sprite": `./phaser-custom-sprite.js`, | ||
"phaser-custom-sprite.min": "./phaser-custom-sprite.js", | ||
}, | ||
|
||
output: { | ||
path: `${__dirname}/dist/`, | ||
filename: '[name].js', | ||
library: 'Phaser', | ||
libraryTarget: 'umd', | ||
sourceMapFilename: '[file].map', | ||
devtoolModuleFilenameTemplate: 'webpack:///[resource-path]', | ||
devtoolFallbackModuleFilenameTemplate: 'webpack:///[resource-path]?[hash]', | ||
umdNamedDefine: true | ||
}, | ||
resolve: { | ||
alias: { | ||
eventemitter3: path.resolve( | ||
__dirname, | ||
"./node_modules/eventemitter3", | ||
), | ||
}, | ||
modules: ["node_modules/phaser/src"], | ||
}, | ||
|
||
performance: { hints: false }, | ||
output: { | ||
path: `${__dirname}/dist/`, | ||
filename: "[name].js", | ||
library: "Phaser", | ||
libraryTarget: "umd", | ||
sourceMapFilename: "[file].map", | ||
devtoolModuleFilenameTemplate: "webpack:///[resource-path]", | ||
devtoolFallbackModuleFilenameTemplate: | ||
"webpack:///[resource-path]?[hash]", | ||
umdNamedDefine: true, | ||
}, | ||
|
||
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 | ||
}) | ||
] | ||
}, | ||
performance: { hints: false }, | ||
|
||
plugins: [ | ||
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(false) | ||
}), | ||
optimization: { | ||
minimizer: [ | ||
new TerserPlugin({ | ||
include: /\.min\.js$/, | ||
terserOptions: { | ||
output: { | ||
comments: false, | ||
}, | ||
}, | ||
}), | ||
], | ||
}, | ||
|
||
new CleanWebpackPlugin() | ||
], | ||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
"typeof CANVAS_RENDERER": JSON.stringify(true), | ||
"typeof WEBGL_RENDERER": JSON.stringify(true), | ||
"typeof WEBGL_DEBUG": JSON.stringify(false), | ||
"typeof EXPERIMENTAL": JSON.stringify(false), | ||
"typeof PLUGIN_3D": JSON.stringify(false), | ||
"typeof PLUGIN_CAMERA3D": JSON.stringify(false), | ||
"typeof PLUGIN_FBINSTANT": JSON.stringify(false), | ||
"typeof FEATURE_SOUND": JSON.stringify(true), | ||
}), | ||
|
||
devtool: 'source-map' | ||
new CleanWebpackPlugin(), | ||
], | ||
|
||
devtool: "source-map", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,68 @@ | ||
'use strict'; | ||
|
||
const webpack = require('webpack'); | ||
const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); | ||
const { CleanWebpackPlugin } = require('clean-webpack-plugin'); | ||
const path = require('path'); | ||
const { CleanWebpackPlugin } = require("clean-webpack-plugin"); | ||
const path = require("path"); | ||
const TerserPlugin = require("terser-webpack-plugin"); | ||
const webpack = require("webpack"); | ||
|
||
module.exports = { | ||
// mode: 'development', | ||
mode: "production", | ||
|
||
// mode: 'development', | ||
mode: 'production', | ||
|
||
entry: { | ||
'phaser-core': `./phaser-core.js`, | ||
'phaser-core.min': './phaser-core.js' | ||
}, | ||
|
||
resolve: { | ||
alias: { | ||
'eventemitter3': path.resolve(__dirname, './node_modules/eventemitter3') | ||
}, | ||
modules: [ 'node_modules/phaser/src' ] | ||
}, | ||
entry: { | ||
"phaser-core": `./phaser-core.js`, | ||
"phaser-core.min": "./phaser-core.js", | ||
}, | ||
|
||
output: { | ||
path: `${__dirname}/dist/`, | ||
filename: '[name].js', | ||
library: 'Phaser', | ||
libraryTarget: 'umd', | ||
sourceMapFilename: '[file].map', | ||
devtoolModuleFilenameTemplate: 'webpack:///[resource-path]', | ||
devtoolFallbackModuleFilenameTemplate: 'webpack:///[resource-path]?[hash]', | ||
umdNamedDefine: true | ||
}, | ||
resolve: { | ||
alias: { | ||
eventemitter3: path.resolve( | ||
__dirname, | ||
"./node_modules/eventemitter3", | ||
), | ||
}, | ||
modules: ["node_modules/phaser/src"], | ||
}, | ||
|
||
performance: { hints: false }, | ||
output: { | ||
path: `${__dirname}/dist/`, | ||
filename: "[name].js", | ||
library: "Phaser", | ||
libraryTarget: "umd", | ||
sourceMapFilename: "[file].map", | ||
devtoolModuleFilenameTemplate: "webpack:///[resource-path]", | ||
devtoolFallbackModuleFilenameTemplate: | ||
"webpack:///[resource-path]?[hash]", | ||
umdNamedDefine: true, | ||
}, | ||
|
||
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 | ||
}) | ||
] | ||
}, | ||
performance: { hints: false }, | ||
|
||
plugins: [ | ||
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(false) | ||
}), | ||
optimization: { | ||
minimizer: [ | ||
new TerserPlugin({ | ||
include: /\.min\.js$/, | ||
terserOptions: { | ||
output: { | ||
comments: false, | ||
}, | ||
}, | ||
}), | ||
], | ||
}, | ||
|
||
new CleanWebpackPlugin() | ||
], | ||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
"typeof CANVAS_RENDERER": JSON.stringify(true), | ||
"typeof WEBGL_RENDERER": JSON.stringify(true), | ||
"typeof WEBGL_DEBUG": JSON.stringify(false), | ||
"typeof EXPERIMENTAL": JSON.stringify(false), | ||
"typeof PLUGIN_3D": JSON.stringify(false), | ||
"typeof PLUGIN_CAMERA3D": JSON.stringify(false), | ||
"typeof PLUGIN_FBINSTANT": JSON.stringify(false), | ||
"typeof FEATURE_SOUND": JSON.stringify(true), | ||
}), | ||
|
||
devtool: 'source-map' | ||
new CleanWebpackPlugin(), | ||
], | ||
|
||
devtool: "source-map", | ||
}; |
Oops, something went wrong.