balm-core 4.8.0 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bundler/webpack/config/common.js +1 -1
- package/lib/plugins/postcss-plugins.js +1 -3
- package/lib/tasks/public/pwa.js +3 -2
- package/package.json +22 -22
- package/tslib/bundler/webpack/config/common.js +1 -1
- package/tslib/plugins/postcss-plugins.js +1 -5
- package/tslib/tasks/public/pwa.js +5 -2
|
@@ -37,7 +37,7 @@ function getDefaultPlugins(webpack, scripts) {
|
|
|
37
37
|
|
|
38
38
|
BalmJS.entries.forEach((entry, index) => {
|
|
39
39
|
const entryName = isSPA ? 'index' : entry.key;
|
|
40
|
-
const chunks = isSPA ? '
|
|
40
|
+
const chunks = isSPA ? 'all' : [entryName];
|
|
41
41
|
const title = titles[index];
|
|
42
42
|
const options = Object.assign({
|
|
43
43
|
filename: BalmJS.file.absPath(`${BalmJS.config.src.base}/${entryName}.html`),
|
|
@@ -8,9 +8,7 @@ function getDefaultPostcssPlugins(isPostCSS = false) {
|
|
|
8
8
|
const defaultPostcssPlugins = isPostCSS || BalmJS.config.styles.extname === 'css' ? [atImport({
|
|
9
9
|
path: BalmJS.file.stylePaths
|
|
10
10
|
}), postcssFlexbugsFixes(), postcssPresetEnv(BalmJS.config.styles.postcssEnvOptions)] : [];
|
|
11
|
-
const cssnanoPlugin = BalmJS.config.env.isProd || BalmJS.config.styles.minify ? [cssnano(
|
|
12
|
-
autoprefixer: false
|
|
13
|
-
}))] : [];
|
|
11
|
+
const cssnanoPlugin = BalmJS.config.env.isProd || BalmJS.config.styles.minify ? [cssnano(BalmJS.config.styles.options)] : [];
|
|
14
12
|
return defaultPostcssPlugins.concat([autoprefixer(), ...cssnanoPlugin, ...BalmJS.config.styles.postcssPlugins]);
|
|
15
13
|
}
|
|
16
14
|
|
package/lib/tasks/public/pwa.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { generateSW, injectManifest } from 'workbox-build';
|
|
2
2
|
|
|
3
3
|
class PwaTask extends BalmJS.BalmTask {
|
|
4
4
|
constructor() {
|
|
@@ -53,7 +53,8 @@ class PwaTask extends BalmJS.BalmTask {
|
|
|
53
53
|
BalmJS.logger.debug(`pwa - ${mode}`, options, {
|
|
54
54
|
pre: true
|
|
55
55
|
});
|
|
56
|
-
|
|
56
|
+
const workboxBuild = mode === 'generateSW' ? generateSW(options) : injectManifest(options);
|
|
57
|
+
await workboxBuild.then(({
|
|
57
58
|
count,
|
|
58
59
|
size
|
|
59
60
|
}) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "balm-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.9.0",
|
|
4
4
|
"description": "BalmJS compiler core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"balm",
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"ansi-colors": "^4.1.3",
|
|
45
|
-
"async": "^3.2.
|
|
45
|
+
"async": "^3.2.4",
|
|
46
46
|
"autoprefixer": "^10.4.7",
|
|
47
47
|
"babel-loader": "^8.2.5",
|
|
48
48
|
"browser-sync": "^2.27.10",
|
|
49
|
-
"connect-history-api-fallback": "^
|
|
49
|
+
"connect-history-api-fallback": "^2.0.0",
|
|
50
50
|
"css-loader": "^6.7.1",
|
|
51
51
|
"css-minimizer-webpack-plugin": "^4.0.0",
|
|
52
|
-
"cssnano": "^5.1.
|
|
52
|
+
"cssnano": "^5.1.12",
|
|
53
53
|
"del": "^6.1.1",
|
|
54
54
|
"dotenv": "^16.0.1",
|
|
55
55
|
"dotenv-expand": "^8.0.3",
|
|
@@ -63,41 +63,41 @@
|
|
|
63
63
|
"gulp-size": "^4.0.1",
|
|
64
64
|
"gulp-useref": "^5.0.0",
|
|
65
65
|
"gulp-zip": "^5.1.0",
|
|
66
|
-
"gulp.spritesmith": "^6.
|
|
67
|
-
"html-loader": "^3.1.
|
|
66
|
+
"gulp.spritesmith": "^6.13.0",
|
|
67
|
+
"html-loader": "^3.1.2",
|
|
68
68
|
"html-minifier": "^4.0.0",
|
|
69
69
|
"html-webpack-plugin": "^5.5.0",
|
|
70
70
|
"http-proxy-middleware": "^2.0.6",
|
|
71
71
|
"imagemin": "^8.0.1",
|
|
72
72
|
"istextorbinary": "^6.0.0",
|
|
73
|
-
"less": "^4.1.
|
|
74
|
-
"mini-css-extract-plugin": "2.
|
|
73
|
+
"less": "^4.1.3",
|
|
74
|
+
"mini-css-extract-plugin": "^2.6.1",
|
|
75
75
|
"modernizr": "^3.12.0",
|
|
76
76
|
"parents": "^1.0.1",
|
|
77
|
-
"plugin-error": "^
|
|
77
|
+
"plugin-error": "^2.0.0",
|
|
78
78
|
"postcss": "^8.4.14",
|
|
79
79
|
"postcss-flexbugs-fixes": "^5.0.2",
|
|
80
80
|
"postcss-import": "^14.1.0",
|
|
81
|
-
"postcss-load-config": "^4.0.
|
|
81
|
+
"postcss-load-config": "^4.0.1",
|
|
82
82
|
"postcss-loader": "7.0.0",
|
|
83
|
-
"postcss-preset-env": "^7.
|
|
83
|
+
"postcss-preset-env": "^7.7.2",
|
|
84
84
|
"pretty-bytes": "^6.0.0",
|
|
85
|
-
"readable-stream": "^
|
|
85
|
+
"readable-stream": "^4.0.0",
|
|
86
86
|
"replace-ext": "^2.0.0",
|
|
87
|
-
"rollup": "^2.75.
|
|
87
|
+
"rollup": "^2.75.7",
|
|
88
88
|
"rollup-plugin-terser": "^7.0.2",
|
|
89
|
-
"sass": "^1.
|
|
90
|
-
"sass-loader": "^13.0.
|
|
91
|
-
"ssh2": "^1.
|
|
89
|
+
"sass": "^1.53.0",
|
|
90
|
+
"sass-loader": "^13.0.2",
|
|
91
|
+
"ssh2": "^1.11.0",
|
|
92
92
|
"strip-ansi": "^7.0.1",
|
|
93
93
|
"style-loader": "^3.3.1",
|
|
94
|
-
"terser": "^5.
|
|
95
|
-
"terser-webpack-plugin": "^5.3.
|
|
94
|
+
"terser": "^5.14.1",
|
|
95
|
+
"terser-webpack-plugin": "^5.3.3",
|
|
96
96
|
"through2": "^4.0.2",
|
|
97
97
|
"through2-concurrent": "^2.0.0",
|
|
98
98
|
"tslib": "^2.4.0",
|
|
99
99
|
"vinyl-sourcemaps-apply": "^0.2.1",
|
|
100
|
-
"webpack": "^5.
|
|
100
|
+
"webpack": "^5.73.0",
|
|
101
101
|
"webpack-bundle-analyzer": "^4.5.0",
|
|
102
102
|
"webpack-dev-middleware": "^5.3.3",
|
|
103
103
|
"webpack-hot-middleware": "^2.25.1",
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
"devDependencies": {
|
|
108
108
|
"@swc/core": "^1.2",
|
|
109
109
|
"@types/express": "^4.17.13",
|
|
110
|
-
"@types/node": "^
|
|
111
|
-
"@types/uglify-js": "^3.
|
|
110
|
+
"@types/node": "^18",
|
|
111
|
+
"@types/uglify-js": "^3.16.0",
|
|
112
112
|
"@types/webpack": "^5.28.0"
|
|
113
113
|
},
|
|
114
114
|
"optionalDependencies": {
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
"engines": {
|
|
121
121
|
"node": ">=14.15.0"
|
|
122
122
|
},
|
|
123
|
-
"gitHead": "
|
|
123
|
+
"gitHead": "ae161996f9ce858909f170f20e5d60fb002cdb73"
|
|
124
124
|
}
|
|
@@ -22,7 +22,7 @@ function getDefaultPlugins(webpack, scripts) {
|
|
|
22
22
|
}
|
|
23
23
|
BalmJS.entries.forEach((entry, index) => {
|
|
24
24
|
const entryName = isSPA ? 'index' : entry.key;
|
|
25
|
-
const chunks = isSPA ? '
|
|
25
|
+
const chunks = isSPA ? 'all' : [entryName];
|
|
26
26
|
const title = titles[index];
|
|
27
27
|
const options = Object.assign({
|
|
28
28
|
filename: BalmJS.file.absPath(`${BalmJS.config.src.base}/${entryName}.html`),
|
|
@@ -12,11 +12,7 @@ function getDefaultPostcssPlugins(isPostCSS = false) {
|
|
|
12
12
|
]
|
|
13
13
|
: [];
|
|
14
14
|
const cssnanoPlugin = BalmJS.config.env.isProd || BalmJS.config.styles.minify
|
|
15
|
-
? [
|
|
16
|
-
cssnano(Object.assign(BalmJS.config.styles.options, {
|
|
17
|
-
autoprefixer: false
|
|
18
|
-
}))
|
|
19
|
-
]
|
|
15
|
+
? [cssnano(BalmJS.config.styles.options)]
|
|
20
16
|
: [];
|
|
21
17
|
return defaultPostcssPlugins.concat([
|
|
22
18
|
autoprefixer(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { generateSW, injectManifest } from 'workbox-build';
|
|
2
2
|
class PwaTask extends BalmJS.BalmTask {
|
|
3
3
|
constructor() {
|
|
4
4
|
super('pwa');
|
|
@@ -43,7 +43,10 @@ class PwaTask extends BalmJS.BalmTask {
|
|
|
43
43
|
BalmJS.logger.debug(`pwa - ${mode}`, options, {
|
|
44
44
|
pre: true
|
|
45
45
|
});
|
|
46
|
-
|
|
46
|
+
const workboxBuild = mode === 'generateSW'
|
|
47
|
+
? generateSW(options)
|
|
48
|
+
: injectManifest(options);
|
|
49
|
+
await workboxBuild
|
|
47
50
|
.then(({ count, size }) => {
|
|
48
51
|
BalmJS.logger.info(`pwa - ${mode}`, `Generated '${swDest}', which will precache ${count} files, totaling ${size} bytes`);
|
|
49
52
|
gulp.parallel(BalmJS.toNamespace('pwa-cache'))();
|