Skip to content

Commit

Permalink
GH-13 Update all npm packages to new versions
Browse files Browse the repository at this point in the history
- Updates all the packages used to the latest versions, shiny!
- Updates the `webpack` and `babel` workflow to more recent, modern versions.
  • Loading branch information
amaccann committed Mar 16, 2020
1 parent 7cce51d commit 8424021
Show file tree
Hide file tree
Showing 7 changed files with 4,213 additions and 2,533 deletions.
18 changes: 18 additions & 0 deletions packages/phaser-navmesh-generation/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"presets": [
["@babel/env", {
"targets": {
"browsers": [
">0.25%",
"not ie 11",
"not op_mini all"
]
},
"modules": false
}],
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-optional-chaining"
]
}
27 changes: 15 additions & 12 deletions packages/phaser-navmesh-generation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,25 @@
"license": "MIT",
"scripts": {
"build": "webpack --config webpack/build.config.js",
"deploy": "yarn build; yarn publish",
"deploy": "yarn build && yarn publish",
"watch": "webpack --watch",
"start": "webpack-dev-server --open --config webpack/dev.config.js"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.0",
"@babel/core": "^7.8.4",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/preset-env": "^7.8.4",
"babel-loader": "^8.0.6",
"cdt2d": "^1.0.0",
"eslint": "^4.6.1",
"expose-loader": "^0.7.3",
"phaser-ce": "^2.8.4",
"phaser-plugin-advanced-timing": "^0.5.0",
"uuid": "^3.1.0",
"webpack": "^3.5.5",
"webpack-dev-server": "^2.7.1"
"clean-webpack-plugin": "^3.0.0",
"eslint": "^6.8.0",
"expose-loader": "^0.7.5",
"phaser-ce": "^2.14.0",
"phaser-plugin-advanced-timing": "^0.5.1",
"terser-webpack-plugin": "^2.3.4",
"uuid": "^3.4.0",
"webpack": "^4.41.5",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.10.3"
}
}
2 changes: 1 addition & 1 deletion packages/phaser-navmesh-generation/src/demo/demoState.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,4 +314,4 @@ export default class DemoState extends State {

this.plugin.removeSprite(this.spriteUUIDs.pop());
}
}
}
28 changes: 18 additions & 10 deletions packages/phaser-navmesh-generation/webpack/build.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');

const { APP_DIR, DIST_DIR } = require('./conf');
const defaultConfig = require('./defaults.config');

module.exports = Object.assign({}, defaultConfig, {
mode: 'production',
entry: {
navmesh: `${APP_DIR}/lib/navMeshPlugin.js`
},
Expand All @@ -14,13 +17,18 @@ module.exports = Object.assign({}, defaultConfig, {
umdNamedDefine: true
},
externals: ['phaser-ce'],
plugins: [ new webpack.optimize.UglifyJsPlugin({
drop_console: true,
sourceMap: true,
minimize: true,
output: {
comments: false
}
}
)]
optimization: {
minimizer: [
new TerserPlugin({
terserOptions: {
output: {
comments: false,
},
},
}),
],
},
plugins: [
new CleanWebpackPlugin(),
]
});
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ module.exports = {
include: APP_DIR,
use: {
loader: 'babel-loader',
options: {
presets: ['env'],
plugins: [require('babel-plugin-transform-object-rest-spread')]
}
}
},
{
Expand All @@ -54,4 +50,4 @@ module.exports = {
}
]
}
};
};
16 changes: 16 additions & 0 deletions packages/phaser-navmesh-generation/webpack/dev.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');

const { APP_DIR, BUILD_DIR, NODE_ENV } = require('./conf');
const defaultConfig = require('./defaults.config');

const minimizer = NODE_ENV === 'production' ? [
new TerserPlugin({
terserOptions: {
output: {
comments: false,
},
},
}),
] : [];

module.exports = Object.assign({}, defaultConfig, {
mode: NODE_ENV,
entry: {
demo: `${APP_DIR}/demo/index.js`
},
Expand All @@ -14,6 +27,9 @@ module.exports = Object.assign({}, defaultConfig, {
}
}
)] : [],
optimization: {
minimizer
},
devServer: {
contentBase: BUILD_DIR,
port: 9999
Expand Down
Loading

0 comments on commit 8424021

Please sign in to comment.