Skip to content

Commit 2af8d3b

Browse files
committed
update build to prepare for openfl-js 9.3.0 update
1 parent 1c54509 commit 2af8d3b

File tree

5 files changed

+25
-137
lines changed

5 files changed

+25
-137
lines changed

package.json

+12-10
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"url": "https://github.com/openfl/starling.git"
3535
},
3636
"scripts": {
37-
"build": "npm run build-lib && npm run build-dist && npm run build-swc && npm run build-docs",
37+
"build": "npm run build-lib && npm run build-dist && npm run build-swc",
3838
"build-dist": "npm run build-dist:dev && npm run build-dist:prod",
3939
"build-dist:dev": "webpack --config webpack.dev.js",
4040
"build-dist:prod": "webpack --config webpack.prod.js",
@@ -48,18 +48,20 @@
4848
"watch": "watch \"echo watch: Compiling... && npm run build-lib -s && echo watch: Compiled successfully.\" ./src ./scripts ./node_modules/openfl/src"
4949
},
5050
"devDependencies": {
51-
"@apache-royale/royale-js": "^0.9.3",
52-
"haxe": "^5.0.10",
51+
"@apache-royale/royale-js": "0.9.8",
52+
"brotli-webpack-plugin": "^1.1.0",
53+
"compression-webpack-plugin": "^10.0.0",
54+
"haxe": "^5.2.1",
5355
"hxgenjs": "kevinresol/hxgenjs",
54-
"typedoc": "^0.9.0",
55-
"typescript": "^2.7.1",
56-
"uglifyjs-webpack-plugin": "^1.1.6",
56+
"typedoc": "^0.11.1",
57+
"typescript": "^5.0.4",
5758
"watch": "^1.0.2",
58-
"webpack": "^3.10.0",
59-
"webpack-merge": "^4.1.1"
59+
"webpack": "^5.79.0",
60+
"webpack-cli": "^5.0.1",
61+
"webpack-merge": "^5.8.0"
6062
},
61-
"dependencies": {
62-
"openfl": "^8.1.1"
63+
"peerDependencies": {
64+
"openfl": "^8.1.1 || ^9.0.0"
6365
},
6466
"haxeDependencies": {
6567
"haxe": "3.4.7"

scripts/ImportAll.hx

-115
This file was deleted.

scripts/build.hxml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-js ../lib/_gen/_.js
22
# --gen-hx-classes
3-
ImportAll
3+
--macro include('starling', true)
44
# -lib starling
55
-cp ../src
66
#-lib hxgenjs

webpack.dev.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const webpack = require ("webpack");
2-
const merge = require ("webpack-merge");
2+
const { merge } = require ("webpack-merge");
33
const common = require ("./webpack.common.js");
44
const package = require ("./package.json");
55

@@ -12,6 +12,7 @@ var banner = "/*!\n"
1212
+ " */";
1313

1414
module.exports = merge (common, {
15+
mode: "development",
1516
output: {
1617
filename: "starling.js"
1718
},

webpack.prod.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
const webpack = require ("webpack");
2-
const merge = require ("webpack-merge");
3-
const UglifyJSPlugin = require ("uglifyjs-webpack-plugin");
2+
const { merge } = require ("webpack-merge");
3+
const BrotliPlugin = require ('brotli-webpack-plugin');
4+
const CompressionPlugin = require ("compression-webpack-plugin");
45
const common = require ("./webpack.common.js");
56
const package = require ("./package.json");
67

78
module.exports = merge (common, {
9+
mode: "production",
810
output: {
911
filename: "starling.min.js"
1012
},
1113
plugins: [
12-
new UglifyJSPlugin ({
13-
sourceMap: true,
14-
uglifyOptions: {
15-
// warnings: true
16-
}
17-
}),
1814
new webpack.BannerPlugin ({
1915
banner: "/*! Starling Framework v" + package.version + " | Simplified BSD (c) Gamua | gamua.com/starling */",
2016
raw: true,
2117
entryOnly: true
2218
}),
23-
new webpack.DefinePlugin ({
24-
"process.env.NODE_ENV": JSON.stringify ("production")
19+
new CompressionPlugin ({
20+
include: /[A-Za-z0-9]*\.min\.js$/
21+
}),
22+
new BrotliPlugin ({
23+
asset: '[path].br[query]',
24+
test: /[A-Za-z0-9]*\.min\.js$/
2525
})
2626
]
2727
});

0 commit comments

Comments
 (0)