mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 22:18:29 +00:00
commit
1de572a0e8
4 changed files with 2633 additions and 518 deletions
14
package.json
14
package.json
|
@ -20,7 +20,7 @@
|
|||
"dist": "webpack --config webpack.dist.config.js",
|
||||
"lint": "eslint --config .eslintrc.json \"src/**/*.js\"",
|
||||
"lintfix": "eslint --config .eslintrc.json \"src/**/*.js\" --fix",
|
||||
"sloc": "node-sloc './src' --include-extensions \"js\""
|
||||
"sloc": "node-sloc \"./src\" --include-extensions \"js\""
|
||||
},
|
||||
"keywords": [
|
||||
"2d",
|
||||
|
@ -35,17 +35,17 @@
|
|||
"web audio"
|
||||
],
|
||||
"devDependencies": {
|
||||
"clean-webpack-plugin": "^0.1.18",
|
||||
"eslint": "^4.13.1",
|
||||
"clean-webpack-plugin": "^0.1.19",
|
||||
"eslint": "^4.19.0",
|
||||
"fs-extra": "^5.0.0",
|
||||
"node-sloc": "^0.1.10",
|
||||
"raw-loader": "^0.5.1",
|
||||
"uglifyjs-webpack-plugin": "^1.1.2",
|
||||
"uuid": "^3.1.0",
|
||||
"webpack": "^3.11.0",
|
||||
"uglifyjs-webpack-plugin": "^1.2.4",
|
||||
"webpack": "^4.1.1",
|
||||
"webpack-cli": "^2.0.12",
|
||||
"webpack-shell-plugin": "^0.5.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"eventemitter3": "^3.0.0"
|
||||
"eventemitter3": "^3.0.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,12 +4,11 @@ const webpack = require('webpack');
|
|||
const WebpackShellPlugin = require('webpack-shell-plugin');
|
||||
|
||||
module.exports = {
|
||||
mode: 'development',
|
||||
|
||||
context: `${__dirname}/src/`,
|
||||
|
||||
entry: {
|
||||
phaser: './phaser.js'
|
||||
},
|
||||
entry: {phaser: './phaser.js'},
|
||||
|
||||
output: {
|
||||
path: `${__dirname}/build/`,
|
||||
|
@ -17,33 +16,28 @@ module.exports = {
|
|||
library: 'Phaser',
|
||||
libraryTarget: 'umd',
|
||||
sourceMapFilename: '[file].map',
|
||||
devtoolModuleFilenameTemplate: "webpack:///[resource-path]", // string
|
||||
devtoolFallbackModuleFilenameTemplate: "webpack:///[resource-path]?[hash]", // string
|
||||
umdNamedDefine: true,
|
||||
devtoolModuleFilenameTemplate: 'webpack:///[resource-path]', // string
|
||||
devtoolFallbackModuleFilenameTemplate: 'webpack:///[resource-path]?[hash]', // string
|
||||
umdNamedDefine: true
|
||||
},
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: [ /\.vert$/, /\.frag$/ ],
|
||||
use: 'raw-loader'
|
||||
}
|
||||
{
|
||||
test: [ /\.vert$/, /\.frag$/ ],
|
||||
use: 'raw-loader'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
plugins: [
|
||||
|
||||
new webpack.DefinePlugin({
|
||||
'CANVAS_RENDERER': JSON.stringify(true),
|
||||
'WEBGL_RENDERER': JSON.stringify(true)
|
||||
CANVAS_RENDERER: JSON.stringify(true),
|
||||
WEBGL_RENDERER: JSON.stringify(true)
|
||||
}),
|
||||
|
||||
new WebpackShellPlugin({
|
||||
onBuildExit: 'node copy-to-examples.js'
|
||||
})
|
||||
|
||||
new WebpackShellPlugin({onBuildExit: 'node copy-to-examples.js'})
|
||||
],
|
||||
|
||||
devtool: 'source-map'
|
||||
|
||||
};
|
||||
|
|
|
@ -5,11 +5,12 @@ const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
|
|||
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
||||
|
||||
module.exports = {
|
||||
mode: 'production',
|
||||
|
||||
context: `${__dirname}/src/`,
|
||||
|
||||
entry: {
|
||||
'phaser': './phaser.js',
|
||||
phaser: './phaser.js',
|
||||
'phaser.min': './phaser.js',
|
||||
'phaser-arcade-physics': './phaser-arcade-physics.js',
|
||||
'phaser-arcade-physics.min': './phaser-arcade-physics.js'
|
||||
|
@ -25,38 +26,37 @@ module.exports = {
|
|||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: [ /\.vert$/, /\.frag$/ ],
|
||||
use: 'raw-loader'
|
||||
}
|
||||
{
|
||||
test: [ /\.vert$/, /\.frag$/ ],
|
||||
use: 'raw-loader'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
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: [
|
||||
|
||||
new webpack.DefinePlugin({
|
||||
'CANVAS_RENDERER': JSON.stringify(true),
|
||||
'WEBGL_RENDERER': JSON.stringify(true)
|
||||
CANVAS_RENDERER: JSON.stringify(true),
|
||||
WEBGL_RENDERER: JSON.stringify(true)
|
||||
}),
|
||||
|
||||
new CleanWebpackPlugin(['dist']),
|
||||
|
||||
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 CleanWebpackPlugin([ 'dist' ])
|
||||
]
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue