Skip to content

Commit 9f13bd1

Browse files
committed
Merge branch 'master' of github.com:krausest/js-framework-benchmark
2 parents 543b943 + 76f8efe commit 9f13bd1

File tree

38 files changed

+7405
-17952
lines changed

38 files changed

+7405
-17952
lines changed

broken-frameworks/keyed/imba/package-lock.json

Lines changed: 962 additions & 8390 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

broken-frameworks/keyed/imba/package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"scripts": {
1111
"build-dev": "webpack --watch",
12-
"build-prod": "webpack"
12+
"build-prod": "webpack --mode=production"
1313
},
1414
"keywords": [
1515
"imba",
@@ -23,11 +23,12 @@
2323
"url": "https://github.com/allain/js-framework-benchmark.git"
2424
},
2525
"devDependencies": {
26-
"terser-webpack-plugin": "1.1.0",
27-
"webpack": "4.22.0",
28-
"webpack-cli": "3.1.2"
26+
"loader-utils": "^1.4.2",
27+
"terser-webpack-plugin": "^5.3.9",
28+
"webpack": "^5.88.2",
29+
"webpack-cli": "^5.1.4"
2930
},
3031
"dependencies": {
31-
"imba": "^1.4.1"
32+
"imba": "^1.5.2"
3233
}
33-
}
34+
}
Lines changed: 46 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,48 @@
1-
const path = require('path')
2-
const webpack = require('webpack')
3-
const TerserPlugin = require('terser-webpack-plugin')
1+
const path = require("path");
2+
const TerserPlugin = require("terser-webpack-plugin");
43

5-
module.exports = {
6-
mode: 'production',
7-
entry: {
8-
main: path.join(__dirname, 'src', 'main.imba')
9-
},
10-
output: {
11-
path: path.join(__dirname, 'dist'),
12-
filename: '[name].js'
13-
},
14-
resolve: {
15-
extensions: ['.imba']
16-
},
17-
module: {
18-
rules: [
19-
{
20-
test: /\.imba$/,
21-
loader: 'imba/loader'
22-
}
23-
]
24-
},
25-
optimization: {
26-
minimizer: [
27-
new TerserPlugin({
28-
terserOptions: {
29-
parse: {
30-
// we want terser to parse ecma 8 code. However, we don't want it
31-
// to apply any minfication steps that turns valid ecma 5 code
32-
// into invalid ecma 5 code. This is why the 'compress' and 'output'
33-
// sections only apply transformations that are ecma 5 safe
34-
// https://github.com/facebook/create-react-app/pull/4234
35-
ecma: 8
36-
},
37-
compress: {
38-
ecma: 5,
39-
warnings: false,
40-
// Disabled because of an issue with Uglify breaking seemingly valid code:
41-
// https://github.com/facebook/create-react-app/issues/2376
42-
// Pending further investigation:
43-
// https://github.com/mishoo/UglifyJS2/issues/2011
44-
comparisons: false
45-
},
46-
mangle: {
47-
safari10: true
48-
},
49-
output: {
50-
ecma: 5,
51-
comments: false,
52-
// Turned on because emoji and regex is not minified properly using default
53-
// https://github.com/facebook/create-react-app/issues/2488
54-
ascii_only: true
55-
}
4+
module.exports = (env, argv) => {
5+
const isProduction = argv.mode === "production";
6+
7+
/** @type {import("webpack").Configuration} */
8+
const config = {
9+
mode: isProduction ? "production" : "development",
10+
entry: {
11+
main: path.join(__dirname, "src", "main.imba"),
12+
},
13+
output: {
14+
path: path.join(__dirname, "dist"),
15+
filename: "[name].js",
16+
},
17+
resolve: {
18+
extensions: [".imba"],
19+
},
20+
module: {
21+
rules: [
22+
{
23+
test: /\.imba$/,
24+
loader: "imba/loader.js",
5625
},
57-
// Use multi-process parallel running to improve the build speed
58-
// Default number of concurrent runs: os.cpus().length - 1
59-
parallel: true,
60-
// Enable file caching
61-
cache: true
62-
})
63-
]
64-
},
65-
plugins: [
66-
new webpack.DefinePlugin({
67-
'process.env': { NODE_ENV: JSON.stringify('production') }
68-
})
69-
]
70-
}
26+
],
27+
},
28+
29+
optimization: {
30+
minimize: isProduction,
31+
minimizer: [
32+
new TerserPlugin({
33+
parallel: true,
34+
terserOptions: {
35+
compress: {
36+
ecma: 5,
37+
comparisons: true,
38+
},
39+
mangle: {
40+
safari10: true,
41+
},
42+
},
43+
}),
44+
],
45+
},
46+
};
47+
return config;
48+
};

0 commit comments

Comments
 (0)