balm-core 3.19.0 → 3.21.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/index.d.ts +3 -0
- package/lib/balm.js +5 -1
- package/lib/bootstrap/index.js +1 -4
- package/lib/bundler/esbuild/transform.js +39 -45
- package/lib/bundler/rollup/index.js +37 -43
- package/lib/bundler/webpack/config/common.js +2 -2
- package/lib/bundler/webpack/config/prod.js +4 -13
- package/lib/bundler/webpack/config/regex.js +1 -1
- package/lib/bundler/webpack/index.js +1 -1
- package/lib/bundler/webpack/output.js +1 -1
- package/lib/config/constants.js +1 -1
- package/lib/config/index.js +0 -1
- package/lib/index.js +5 -5
- package/lib/middlewares/proxy.js +3 -1
- package/lib/plugins/less.js +55 -4
- package/lib/plugins/plumber.js +1 -1
- package/lib/plugins/postcss.js +1 -0
- package/lib/plugins/replace.js +2 -2
- package/lib/plugins/sass.js +8 -16
- package/lib/tasks/foundation/balm_style.js +1 -1
- package/lib/tasks/index.js +3 -1
- package/lib/tasks/private/build.js +3 -1
- package/lib/tasks/private/cache.js +4 -2
- package/lib/tasks/private/clean.js +5 -1
- package/lib/tasks/private/extra.js +3 -1
- package/lib/tasks/private/font.js +3 -1
- package/lib/tasks/private/image.js +3 -1
- package/lib/tasks/private/lint.js +3 -1
- package/lib/tasks/private/media.js +3 -1
- package/lib/tasks/private/modernizr.js +10 -4
- package/lib/tasks/private/sprite.js +6 -2
- package/lib/tasks/private/start.js +3 -1
- package/lib/tasks/private/workbox-sw.js +3 -1
- package/lib/tasks/public/ftp.js +3 -1
- package/lib/tasks/public/html.js +6 -2
- package/lib/tasks/public/publish.js +5 -1
- package/lib/tasks/public/remove.js +5 -1
- package/lib/tasks/public/server.js +9 -3
- package/lib/tasks/public/url.js +5 -1
- package/lib/utilities/cache-core.js +4 -3
- package/lib/utilities/compiling.js +5 -1
- package/lib/utilities/loading.js +7 -3
- package/lib/utilities/logger.js +5 -1
- package/package.json +32 -32
- package/tslib/balm.js +9 -9
- package/tslib/bootstrap/index.js +4 -6
- package/tslib/bundler/esbuild/index.js +4 -4
- package/tslib/bundler/esbuild/transform.js +2 -2
- package/tslib/bundler/rollup/entry.js +1 -1
- package/tslib/bundler/rollup/index.js +8 -8
- package/tslib/bundler/rollup/output.js +1 -1
- package/tslib/bundler/webpack/config/common.js +4 -4
- package/tslib/bundler/webpack/config/dev.js +3 -3
- package/tslib/bundler/webpack/config/index.js +4 -4
- package/tslib/bundler/webpack/config/prod.js +5 -14
- package/tslib/bundler/webpack/index.js +8 -8
- package/tslib/bundler/webpack/loaders.js +4 -4
- package/tslib/bundler/webpack/output.js +1 -1
- package/tslib/config/globals.js +3 -3
- package/tslib/config/index.js +13 -14
- package/tslib/config/version.js +1 -1
- package/tslib/hello.js +2 -2
- package/tslib/hooks/index.js +1 -1
- package/tslib/index.js +2 -2
- package/tslib/middlewares/index.js +6 -6
- package/tslib/middlewares/proxy.js +2 -1
- package/tslib/plugins/imagemin.js +6 -4
- package/tslib/plugins/index.js +11 -11
- package/tslib/plugins/less.js +54 -9
- package/tslib/plugins/postcss.js +2 -2
- package/tslib/plugins/replace.js +2 -2
- package/tslib/plugins/sass.js +13 -12
- package/tslib/plugins/sftp.js +1 -1
- package/tslib/tasks/foundation/balm_style.js +2 -2
- package/tslib/tasks/foundation/index.js +2 -2
- package/tslib/tasks/index.js +7 -6
- package/tslib/tasks/private/cache.js +1 -1
- package/tslib/tasks/private/clean.js +2 -2
- package/tslib/tasks/private/image.js +1 -1
- package/tslib/tasks/private/modernizr.js +4 -4
- package/tslib/tasks/private/sprite.js +5 -5
- package/tslib/tasks/public/esbuild.js +2 -2
- package/tslib/tasks/public/ftp.js +2 -1
- package/tslib/tasks/public/html.js +5 -5
- package/tslib/tasks/public/publish.js +4 -4
- package/tslib/tasks/public/remove.js +1 -1
- package/tslib/tasks/public/rollup.js +2 -2
- package/tslib/tasks/public/server.js +13 -12
- package/tslib/tasks/public/url.js +2 -2
- package/tslib/tasks/public/webpack.js +2 -2
- package/tslib/utilities/address.js +1 -1
- package/tslib/utilities/cache-core.js +10 -9
- package/tslib/utilities/color.js +1 -1
- package/tslib/utilities/compiling.js +4 -4
- package/tslib/utilities/detect-port.js +2 -2
- package/tslib/utilities/file.js +3 -3
- package/tslib/utilities/index.js +4 -4
- package/tslib/utilities/loading.js +9 -8
- package/tslib/utilities/logger.js +9 -9
- package/tslib/utilities/replacestream.js +3 -3
- package/tslib/utilities/utils.js +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "balm-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.21.0",
|
|
4
4
|
"description": "BalmJS compiler core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"balm",
|
|
@@ -41,16 +41,16 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"ansi-colors": "^4.1.1",
|
|
44
|
-
"async": "^3.2.
|
|
45
|
-
"autoprefixer": "^10.2
|
|
46
|
-
"babel-loader": "^8.2.
|
|
47
|
-
"browser-sync": "^2.
|
|
44
|
+
"async": "^3.2.3",
|
|
45
|
+
"autoprefixer": "^10.4.2",
|
|
46
|
+
"babel-loader": "^8.2.3",
|
|
47
|
+
"browser-sync": "^2.27.7",
|
|
48
48
|
"connect-history-api-fallback": "^1.6.0",
|
|
49
|
-
"css-loader": "
|
|
50
|
-
"cssnano": "^5.0.
|
|
49
|
+
"css-loader": "5",
|
|
50
|
+
"cssnano": "^5.0.15",
|
|
51
51
|
"del": "^6.0.0",
|
|
52
|
-
"esbuild": "^0.
|
|
53
|
-
"fancy-log": "^
|
|
52
|
+
"esbuild": "^0.14",
|
|
53
|
+
"fancy-log": "^2.0.0",
|
|
54
54
|
"file-loader": "^6.2.0",
|
|
55
55
|
"gulp-eslint": "^6.0.0",
|
|
56
56
|
"gulp-if": "^3.0.0",
|
|
@@ -66,46 +66,46 @@
|
|
|
66
66
|
"html-webpack-plugin": "4",
|
|
67
67
|
"http-proxy-middleware": "1",
|
|
68
68
|
"imagemin": "7",
|
|
69
|
-
"istextorbinary": "^
|
|
70
|
-
"less": "^4.1.
|
|
71
|
-
"mini-css-extract-plugin": "
|
|
72
|
-
"modernizr": "^3.11.
|
|
73
|
-
"optimize-css-assets-webpack-plugin": "^6.0.
|
|
69
|
+
"istextorbinary": "^6.0.0",
|
|
70
|
+
"less": "^4.1.2",
|
|
71
|
+
"mini-css-extract-plugin": "1",
|
|
72
|
+
"modernizr": "^3.11.8",
|
|
73
|
+
"optimize-css-assets-webpack-plugin": "^6.0.1",
|
|
74
74
|
"parents": "^1.0.1",
|
|
75
75
|
"plugin-error": "^1.0.1",
|
|
76
|
-
"postcss": "^8.
|
|
76
|
+
"postcss": "^8.4.5",
|
|
77
77
|
"postcss-import": "^14.0.2",
|
|
78
|
-
"postcss-load-config": "^3.
|
|
78
|
+
"postcss-load-config": "^3.1.1",
|
|
79
79
|
"postcss-loader": "4",
|
|
80
|
-
"postcss-preset-env": "
|
|
81
|
-
"postcss-safe-parser": "
|
|
80
|
+
"postcss-preset-env": "6",
|
|
81
|
+
"postcss-safe-parser": "5",
|
|
82
82
|
"pretty-bytes": "^5.6.0",
|
|
83
83
|
"readable-stream": "^3.6.0",
|
|
84
84
|
"replace-ext": "^2.0.0",
|
|
85
85
|
"require-dir": "^1.2.0",
|
|
86
|
-
"rollup": "^2.
|
|
86
|
+
"rollup": "^2.64.0",
|
|
87
87
|
"rollup-plugin-terser": "^7.0.2",
|
|
88
|
-
"sass": "
|
|
89
|
-
"ssh2": "
|
|
88
|
+
"sass": "1.39.2",
|
|
89
|
+
"ssh2": "0.8.9",
|
|
90
90
|
"strip-ansi": "6",
|
|
91
|
-
"style-loader": "
|
|
92
|
-
"terser": "^5.
|
|
91
|
+
"style-loader": "2",
|
|
92
|
+
"terser": "^5.10.0",
|
|
93
93
|
"terser-webpack-plugin": "4",
|
|
94
94
|
"through2": "^4.0.2",
|
|
95
95
|
"through2-concurrent": "^2.0.0",
|
|
96
|
-
"tslib": "^2.
|
|
96
|
+
"tslib": "^2.3.1",
|
|
97
97
|
"url-loader": "^4.1.1",
|
|
98
98
|
"vinyl-sourcemaps-apply": "^0.2.1",
|
|
99
99
|
"webpack": "4",
|
|
100
|
-
"webpack-bundle-analyzer": "^4.
|
|
100
|
+
"webpack-bundle-analyzer": "^4.5.0",
|
|
101
101
|
"webpack-dev-middleware": "3",
|
|
102
|
-
"webpack-hot-middleware": "^2.25.
|
|
103
|
-
"webpack-merge": "^5.
|
|
104
|
-
"workbox-build": "^6.
|
|
102
|
+
"webpack-hot-middleware": "^2.25.1",
|
|
103
|
+
"webpack-merge": "^5.8.0",
|
|
104
|
+
"workbox-build": "^6.4.2"
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
|
-
"@types/express": "^4.17.
|
|
108
|
-
"@types/node": "^
|
|
107
|
+
"@types/express": "^4.17.13",
|
|
108
|
+
"@types/node": "^17.0.8",
|
|
109
109
|
"@types/webpack": "4"
|
|
110
110
|
},
|
|
111
111
|
"optionalDependencies": {
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"imagemin-svgo": "^9.0.0"
|
|
116
116
|
},
|
|
117
117
|
"engines": {
|
|
118
|
-
"node": ">=10.
|
|
118
|
+
"node": ">=10.13.0"
|
|
119
119
|
},
|
|
120
|
-
"gitHead": "
|
|
120
|
+
"gitHead": "6b13ad753b6a6d20435a5a80d3f703c3f1a4820c"
|
|
121
121
|
}
|
package/tslib/balm.js
CHANGED
|
@@ -5,32 +5,32 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
require("./config");
|
|
6
6
|
require("./utilities");
|
|
7
7
|
require("./plugins");
|
|
8
|
-
const tasks_1 = tslib_1.__importDefault(require("./tasks"));
|
|
8
|
+
const tasks_1 = (0, tslib_1.__importDefault)(require("./tasks"));
|
|
9
9
|
const bootstrap_1 = require("./bootstrap");
|
|
10
|
-
const loading_1 = tslib_1.__importDefault(require("./utilities/loading"));
|
|
10
|
+
const loading_1 = (0, tslib_1.__importDefault)(require("./utilities/loading"));
|
|
11
11
|
class Balm {
|
|
12
12
|
constructor() {
|
|
13
13
|
_Balm_config.set(this, void 0);
|
|
14
14
|
BalmJS.loading = false;
|
|
15
15
|
loading_1.default.succeed();
|
|
16
|
-
tslib_1.__classPrivateFieldSet(this, _Balm_config, BalmJS.config, "f");
|
|
16
|
+
(0, tslib_1.__classPrivateFieldSet)(this, _Balm_config, BalmJS.config, "f");
|
|
17
17
|
}
|
|
18
18
|
get config() {
|
|
19
|
-
return tslib_1.__classPrivateFieldGet(this, _Balm_config, "f");
|
|
19
|
+
return (0, tslib_1.__classPrivateFieldGet)(this, _Balm_config, "f");
|
|
20
20
|
}
|
|
21
21
|
set config(value) {
|
|
22
|
-
tslib_1.__classPrivateFieldSet(this, _Balm_config, bootstrap_1.setConfig(value), "f");
|
|
23
|
-
BalmJS.config = tslib_1.__classPrivateFieldGet(this, _Balm_config, "f");
|
|
22
|
+
(0, tslib_1.__classPrivateFieldSet)(this, _Balm_config, (0, bootstrap_1.setConfig)(value), "f");
|
|
23
|
+
BalmJS.config = (0, tslib_1.__classPrivateFieldGet)(this, _Balm_config, "f");
|
|
24
24
|
}
|
|
25
25
|
set beforeTask(name) {
|
|
26
|
-
BalmJS.beforeTask = bootstrap_1.setTask(name);
|
|
26
|
+
BalmJS.beforeTask = (0, bootstrap_1.setTask)(name);
|
|
27
27
|
}
|
|
28
28
|
set afterTask(name) {
|
|
29
|
-
BalmJS.afterTask = bootstrap_1.setTask(name);
|
|
29
|
+
BalmJS.afterTask = (0, bootstrap_1.setTask)(name);
|
|
30
30
|
}
|
|
31
31
|
go(recipe = NOOP) {
|
|
32
32
|
if (BalmJS.utils.isFunction(recipe)) {
|
|
33
|
-
tasks_1.default(recipe);
|
|
33
|
+
(0, tasks_1.default)(recipe);
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
36
|
BalmJS.logger.error('initialization', 'BalmJS API: `balm.go(function(mix) {});`');
|
package/tslib/bootstrap/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setTask = exports.setConfig = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const check_config_1 = tslib_1.__importDefault(require("./check_config"));
|
|
5
|
+
const check_config_1 = (0, tslib_1.__importDefault)(require("./check_config"));
|
|
6
6
|
const constants_1 = require("../config/constants");
|
|
7
7
|
function createQuickPath(config, rootKey) {
|
|
8
8
|
const result = {};
|
|
@@ -33,10 +33,8 @@ function ready(config) {
|
|
|
33
33
|
const HMR_Enabling = config.scripts.bundler === BalmJS.Bundler.webpack && !config.scripts.ie8;
|
|
34
34
|
config.server.useHMR = HMR_ENV && HMR_Enabling;
|
|
35
35
|
config.inDesktopApp = /^electron-.*/.test(config.scripts.target);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
config.env.isProd && config.assets.cache && config.scripts.injectHtml;
|
|
39
|
-
}
|
|
36
|
+
config.scripts.useCache =
|
|
37
|
+
config.env.isProd && config.assets.cache && config.scripts.injectHtml;
|
|
40
38
|
return config;
|
|
41
39
|
}
|
|
42
40
|
function resetConfig() {
|
|
@@ -47,7 +45,7 @@ function resetConfig() {
|
|
|
47
45
|
function setConfig(customConfig) {
|
|
48
46
|
const defaultConfig = resetConfig();
|
|
49
47
|
const newConfig = BalmJS.utils.deepMerge(defaultConfig, customConfig);
|
|
50
|
-
check_config_1.default();
|
|
48
|
+
(0, check_config_1.default)();
|
|
51
49
|
let config = BalmJS.utils.deepMerge(newConfig, {
|
|
52
50
|
paths: {
|
|
53
51
|
tmp: newConfig.paths.target
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const build_1 = tslib_1.__importDefault(require("./build"));
|
|
5
|
-
const transform_1 = tslib_1.__importDefault(require("./transform"));
|
|
4
|
+
const build_1 = (0, tslib_1.__importDefault)(require("./build"));
|
|
5
|
+
const transform_1 = (0, tslib_1.__importDefault)(require("./transform"));
|
|
6
6
|
const esbuild = (input, output, customOptions, callback) => {
|
|
7
7
|
const entryPoints = BalmJS.utils.isString(input)
|
|
8
8
|
? [input]
|
|
9
9
|
: input;
|
|
10
10
|
BalmJS.config.scripts.useTransform
|
|
11
|
-
? transform_1.default(entryPoints, output, customOptions, callback)
|
|
12
|
-
: build_1.default(entryPoints, output, customOptions, callback);
|
|
11
|
+
? (0, transform_1.default)(entryPoints, output, customOptions, callback)
|
|
12
|
+
: (0, build_1.default)(entryPoints, output, customOptions, callback);
|
|
13
13
|
};
|
|
14
14
|
exports.default = esbuild;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
4
|
+
const fs_1 = (0, tslib_1.__importDefault)(require("fs"));
|
|
5
5
|
const options_1 = require("./options");
|
|
6
6
|
const esTransform = (entryPoints, output, customTransformOptions, callback) => {
|
|
7
7
|
const build = {
|
|
@@ -15,7 +15,7 @@ const esTransform = (entryPoints, output, customTransformOptions, callback) => {
|
|
|
15
15
|
var e_1, _a;
|
|
16
16
|
try {
|
|
17
17
|
try {
|
|
18
|
-
for (var entryPoints_1 = tslib_1.__asyncValues(entryPoints), entryPoints_1_1; entryPoints_1_1 = await entryPoints_1.next(), !entryPoints_1_1.done;) {
|
|
18
|
+
for (var entryPoints_1 = (0, tslib_1.__asyncValues)(entryPoints), entryPoints_1_1; entryPoints_1_1 = await entryPoints_1.next(), !entryPoints_1_1.done;) {
|
|
19
19
|
const entryPoint = entryPoints_1_1.value;
|
|
20
20
|
build.input = BalmJS.file.absPath(entryPoint);
|
|
21
21
|
BalmJS.logger.debug('esbuild bundler - transform', {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const plugins_1 = require("./plugins");
|
|
4
4
|
function getEntry(inputOptions) {
|
|
5
|
-
const inputPlugins = plugins_1.getInputPlugins(inputOptions);
|
|
5
|
+
const inputPlugins = (0, plugins_1.getInputPlugins)(inputOptions);
|
|
6
6
|
const options = Object.assign({}, BalmJS.config.scripts.inputOptions, inputOptions);
|
|
7
7
|
options.plugins = inputPlugins;
|
|
8
8
|
const { input } = options;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const entry_1 = tslib_1.__importDefault(require("./entry"));
|
|
5
|
-
const output_1 = tslib_1.__importDefault(require("./output"));
|
|
6
|
-
const build_1 = tslib_1.__importDefault(require("./build"));
|
|
4
|
+
const entry_1 = (0, tslib_1.__importDefault)(require("./entry"));
|
|
5
|
+
const output_1 = (0, tslib_1.__importDefault)(require("./output"));
|
|
6
|
+
const build_1 = (0, tslib_1.__importDefault)(require("./build"));
|
|
7
7
|
const buildLibrary = async (inputOptions, outputOptions) => {
|
|
8
8
|
var e_1, _a;
|
|
9
9
|
const rollup = require('rollup');
|
|
10
|
-
inputOptions = entry_1.default(inputOptions);
|
|
11
|
-
outputOptions = output_1.default(outputOptions);
|
|
10
|
+
inputOptions = (0, entry_1.default)(inputOptions);
|
|
11
|
+
outputOptions = (0, output_1.default)(outputOptions);
|
|
12
12
|
const rollupOptions = Object.assign({}, inputOptions, {
|
|
13
13
|
output: outputOptions
|
|
14
14
|
});
|
|
15
15
|
const bundle = await rollup.rollup(rollupOptions);
|
|
16
16
|
if (Array.isArray(outputOptions)) {
|
|
17
17
|
try {
|
|
18
|
-
for (var outputOptions_1 = tslib_1.__asyncValues(outputOptions), outputOptions_1_1; outputOptions_1_1 = await outputOptions_1.next(), !outputOptions_1_1.done;) {
|
|
18
|
+
for (var outputOptions_1 = (0, tslib_1.__asyncValues)(outputOptions), outputOptions_1_1; outputOptions_1_1 = await outputOptions_1.next(), !outputOptions_1_1.done;) {
|
|
19
19
|
const outputOption = outputOptions_1_1.value;
|
|
20
|
-
await build_1.default(bundle, outputOption);
|
|
20
|
+
await (0, build_1.default)(bundle, outputOption);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -29,7 +29,7 @@ const buildLibrary = async (inputOptions, outputOptions) => {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
|
-
await build_1.default(bundle, outputOptions);
|
|
32
|
+
await (0, build_1.default)(bundle, outputOptions);
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
exports.default = buildLibrary;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const plugins_1 = require("./plugins");
|
|
4
4
|
function setOutput(outputOptions) {
|
|
5
|
-
const outputPlugins = plugins_1.getOutputPlugins(outputOptions);
|
|
5
|
+
const outputPlugins = (0, plugins_1.getOutputPlugins)(outputOptions);
|
|
6
6
|
outputOptions = Object.assign({}, BalmJS.config.scripts.outputOptions, outputOptions);
|
|
7
7
|
outputOptions.plugins = outputPlugins;
|
|
8
8
|
if (outputOptions.dir) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const loaders_1 = tslib_1.__importDefault(require("../loaders"));
|
|
4
|
+
const loaders_1 = (0, tslib_1.__importDefault)(require("../loaders"));
|
|
5
5
|
const constants_1 = require("../../../config/constants");
|
|
6
6
|
function getDefaultPlugins(webpack, scripts) {
|
|
7
7
|
const plugins = [
|
|
@@ -37,7 +37,7 @@ function getSplitChunks() {
|
|
|
37
37
|
const jsFolder = BalmJS.config.paths.target.js;
|
|
38
38
|
let cacheGroups = {};
|
|
39
39
|
if (scripts.extractAllVendors) {
|
|
40
|
-
const jsFilename =
|
|
40
|
+
const jsFilename = scripts.useCache
|
|
41
41
|
? `${scripts.vendorName}.${constants_1.HASH_NAME_PROD}.js`
|
|
42
42
|
: `${scripts.vendorName}.js`;
|
|
43
43
|
cacheGroups = {
|
|
@@ -54,7 +54,7 @@ function getSplitChunks() {
|
|
|
54
54
|
for (const vendor of BalmJS.vendors) {
|
|
55
55
|
const cacheGroupKey = vendor.key;
|
|
56
56
|
const cacheGroupModules = vendor.value.join('|');
|
|
57
|
-
const jsFilename =
|
|
57
|
+
const jsFilename = scripts.useCache
|
|
58
58
|
? `${cacheGroupKey}.${constants_1.HASH_NAME_PROD}.js`
|
|
59
59
|
: `${cacheGroupKey}.js`;
|
|
60
60
|
cacheGroups[cacheGroupKey] = {
|
|
@@ -87,7 +87,7 @@ function getCommonConfig(webpack, scripts) {
|
|
|
87
87
|
context: BalmJS.config.workspace,
|
|
88
88
|
mode: 'none',
|
|
89
89
|
module: {
|
|
90
|
-
rules: loaders_1.default(scripts.loaders),
|
|
90
|
+
rules: (0, loaders_1.default)(scripts.loaders),
|
|
91
91
|
strictExportPresence: true
|
|
92
92
|
},
|
|
93
93
|
resolve: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const webpack_merge_1 = tslib_1.__importDefault(require("webpack-merge"));
|
|
5
|
-
const common_1 = tslib_1.__importDefault(require("./common"));
|
|
4
|
+
const webpack_merge_1 = (0, tslib_1.__importDefault)(require("webpack-merge"));
|
|
5
|
+
const common_1 = (0, tslib_1.__importDefault)(require("./common"));
|
|
6
6
|
function getDevConfig(webpack, scripts) {
|
|
7
|
-
return webpack_merge_1.default(common_1.default(webpack, scripts), {
|
|
7
|
+
return (0, webpack_merge_1.default)((0, common_1.default)(webpack, scripts), {
|
|
8
8
|
mode: 'development',
|
|
9
9
|
plugins: [
|
|
10
10
|
new webpack.HotModuleReplacementPlugin()
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const dev_1 = tslib_1.__importDefault(require("./dev"));
|
|
5
|
-
const prod_1 = tslib_1.__importDefault(require("./prod"));
|
|
4
|
+
const dev_1 = (0, tslib_1.__importDefault)(require("./dev"));
|
|
5
|
+
const prod_1 = (0, tslib_1.__importDefault)(require("./prod"));
|
|
6
6
|
function getDefaultConfig(webpack, scripts) {
|
|
7
7
|
return BalmJS.config.env.isProd || scripts.minify || scripts.ie8
|
|
8
|
-
? prod_1.default(webpack, scripts)
|
|
9
|
-
: dev_1.default(webpack, scripts);
|
|
8
|
+
? (0, prod_1.default)(webpack, scripts)
|
|
9
|
+
: (0, dev_1.default)(webpack, scripts);
|
|
10
10
|
}
|
|
11
11
|
exports.default = getDefaultConfig;
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const webpack_merge_1 = tslib_1.__importDefault(require("webpack-merge"));
|
|
5
|
-
const common_1 = tslib_1.__importDefault(require("./common"));
|
|
4
|
+
const webpack_merge_1 = (0, tslib_1.__importDefault)(require("webpack-merge"));
|
|
5
|
+
const common_1 = (0, tslib_1.__importDefault)(require("./common"));
|
|
6
6
|
const constants_1 = require("../../../config/constants");
|
|
7
7
|
const bundleAnalyzerReport = process.env.npm_config_report || false;
|
|
8
|
-
|
|
9
|
-
let filename;
|
|
10
|
-
if (isChunk) {
|
|
11
|
-
filename = BalmJS.config.env.isProd ? `[name].${constants_1.HASH_NAME_PROD}` : '[name]';
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
filename = BalmJS.useCache ? `[name].${constants_1.HASH_NAME_PROD}` : '[name]';
|
|
15
|
-
}
|
|
16
|
-
return `${BalmJS.config.paths.target.css}/${constants_1.ASYNC_SCRIPTS}/${filename}.css`;
|
|
17
|
-
}
|
|
8
|
+
const getCssFilename = () => `${BalmJS.config.paths.target.css}/${constants_1.ASYNC_SCRIPTS}/[name].${constants_1.HASH_NAME_PROD}.css`;
|
|
18
9
|
function getProdConfig(webpack, scripts) {
|
|
19
10
|
const TerserPlugin = require('terser-webpack-plugin');
|
|
20
11
|
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
|
@@ -26,7 +17,7 @@ function getProdConfig(webpack, scripts) {
|
|
|
26
17
|
if (scripts.ie8) {
|
|
27
18
|
terserOptions.ie8 = true;
|
|
28
19
|
}
|
|
29
|
-
return webpack_merge_1.default(common_1.default(webpack, scripts), {
|
|
20
|
+
return (0, webpack_merge_1.default)((0, common_1.default)(webpack, scripts), {
|
|
30
21
|
mode: 'production',
|
|
31
22
|
optimization: {
|
|
32
23
|
minimizer: [
|
|
@@ -56,7 +47,7 @@ function getProdConfig(webpack, scripts) {
|
|
|
56
47
|
? [
|
|
57
48
|
new MiniCssExtractPlugin({
|
|
58
49
|
filename: BalmJS.file.assetsPath(getCssFilename()),
|
|
59
|
-
chunkFilename: BalmJS.file.assetsPath(getCssFilename(
|
|
50
|
+
chunkFilename: BalmJS.file.assetsPath(getCssFilename())
|
|
60
51
|
})
|
|
61
52
|
]
|
|
62
53
|
: []),
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.webpackConfig = exports.webpack = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const webpack_merge_1 = tslib_1.__importDefault(require("webpack-merge"));
|
|
6
|
-
const entry_1 = tslib_1.__importDefault(require("./entry"));
|
|
7
|
-
const output_1 = tslib_1.__importDefault(require("./output"));
|
|
8
|
-
const config_1 = tslib_1.__importDefault(require("./config"));
|
|
5
|
+
const webpack_merge_1 = (0, tslib_1.__importDefault)(require("webpack-merge"));
|
|
6
|
+
const entry_1 = (0, tslib_1.__importDefault)(require("./entry"));
|
|
7
|
+
const output_1 = (0, tslib_1.__importDefault)(require("./output"));
|
|
8
|
+
const config_1 = (0, tslib_1.__importDefault)(require("./config"));
|
|
9
9
|
const webpackModule = process.env.WEBPACK || require.resolve('webpack');
|
|
10
10
|
const webpack = require(webpackModule);
|
|
11
11
|
exports.webpack = webpack;
|
|
@@ -13,8 +13,8 @@ function webpackConfig(input, output, customWebpackOptions = {}, isHook = false)
|
|
|
13
13
|
const scripts = BalmJS.config.scripts;
|
|
14
14
|
const defaultEntry = `./${BalmJS.file.defaultEntry}`;
|
|
15
15
|
const baseConfig = {
|
|
16
|
-
entry: input ? entry_1.default(input, scripts) : defaultEntry,
|
|
17
|
-
output: output_1.default(output, scripts, isHook)
|
|
16
|
+
entry: input ? (0, entry_1.default)(input, scripts) : defaultEntry,
|
|
17
|
+
output: (0, output_1.default)(output, scripts, isHook)
|
|
18
18
|
};
|
|
19
19
|
BalmJS.logger.debug('webpack bundler', {
|
|
20
20
|
input: baseConfig.entry,
|
|
@@ -25,7 +25,7 @@ function webpackConfig(input, output, customWebpackOptions = {}, isHook = false)
|
|
|
25
25
|
if (scripts.externals) {
|
|
26
26
|
baseConfig.externals = scripts.externals;
|
|
27
27
|
}
|
|
28
|
-
const defaultConfig = config_1.default(webpack, scripts);
|
|
28
|
+
const defaultConfig = (0, config_1.default)(webpack, scripts);
|
|
29
29
|
if (defaultConfig.target === 'web') {
|
|
30
30
|
defaultConfig.node = {
|
|
31
31
|
module: 'empty',
|
|
@@ -38,7 +38,7 @@ function webpackConfig(input, output, customWebpackOptions = {}, isHook = false)
|
|
|
38
38
|
child_process: 'empty'
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
const configuration = webpack_merge_1.default(baseConfig, defaultConfig, scripts.webpackOptions, customWebpackOptions);
|
|
41
|
+
const configuration = (0, webpack_merge_1.default)(baseConfig, defaultConfig, scripts.webpackOptions, customWebpackOptions);
|
|
42
42
|
BalmJS.logger.success('webpack configuration', configuration, {
|
|
43
43
|
pre: true
|
|
44
44
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const webpack_merge_1 = tslib_1.__importDefault(require("webpack-merge"));
|
|
5
|
-
const require_dir_1 = tslib_1.__importDefault(require("require-dir"));
|
|
6
|
-
const LOADERS = require_dir_1.default('./rules');
|
|
4
|
+
const webpack_merge_1 = (0, tslib_1.__importDefault)(require("webpack-merge"));
|
|
5
|
+
const require_dir_1 = (0, tslib_1.__importDefault)(require("require-dir"));
|
|
6
|
+
const LOADERS = (0, require_dir_1.default)('./rules');
|
|
7
7
|
function getLoaders(customLoaders) {
|
|
8
8
|
const enableDefaultLoaders = Object.assign({
|
|
9
9
|
html: true,
|
|
@@ -28,7 +28,7 @@ function getLoaders(customLoaders) {
|
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
const result = webpack_merge_1.default({
|
|
31
|
+
const result = (0, webpack_merge_1.default)({
|
|
32
32
|
module: {
|
|
33
33
|
rules: defaultLoaders
|
|
34
34
|
}
|
|
@@ -7,7 +7,7 @@ function getFilename(scripts, isChunk = false) {
|
|
|
7
7
|
filename = BalmJS.config.env.isProd ? `[name].${constants_1.HASH_NAME_PROD}` : '[name]';
|
|
8
8
|
}
|
|
9
9
|
else {
|
|
10
|
-
filename =
|
|
10
|
+
filename = scripts.useCache ? `[name].${constants_1.HASH_NAME_PROD}` : '[name]';
|
|
11
11
|
}
|
|
12
12
|
return `${filename}.js`;
|
|
13
13
|
}
|
package/tslib/config/globals.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
5
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
|
-
const ansi_colors_1 = tslib_1.__importDefault(require("ansi-colors"));
|
|
4
|
+
const fs_1 = (0, tslib_1.__importDefault)(require("fs"));
|
|
5
|
+
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
6
|
+
const ansi_colors_1 = (0, tslib_1.__importDefault)(require("ansi-colors"));
|
|
7
7
|
process.env.BALM_CWD = process.env.INIT_CWD || process.cwd();
|
|
8
8
|
const gulpModule = `${process.env.BALM || process.env.BALM_CWD}/node_modules/gulp/index.js`;
|
|
9
9
|
if (!fs_1.default.existsSync(gulpModule)) {
|
package/tslib/config/index.js
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
require("./globals");
|
|
5
|
-
const env_1 = tslib_1.__importDefault(require("./env"));
|
|
6
|
-
const roots_1 = tslib_1.__importDefault(require("./roots"));
|
|
7
|
-
const paths_1 = tslib_1.__importDefault(require("./paths"));
|
|
8
|
-
const html_1 = tslib_1.__importDefault(require("./html"));
|
|
9
|
-
const styles_1 = tslib_1.__importDefault(require("./styles"));
|
|
10
|
-
const scripts_1 = tslib_1.__importDefault(require("./scripts"));
|
|
11
|
-
const images_1 = tslib_1.__importDefault(require("./images"));
|
|
12
|
-
const extras_1 = tslib_1.__importDefault(require("./extras"));
|
|
13
|
-
const assets_1 = tslib_1.__importDefault(require("./assets"));
|
|
14
|
-
const server_1 = tslib_1.__importDefault(require("./server"));
|
|
15
|
-
const ftp_1 = tslib_1.__importDefault(require("./ftp"));
|
|
16
|
-
const pwa_1 = tslib_1.__importDefault(require("./pwa"));
|
|
17
|
-
const logs_1 = tslib_1.__importDefault(require("./logs"));
|
|
5
|
+
const env_1 = (0, tslib_1.__importDefault)(require("./env"));
|
|
6
|
+
const roots_1 = (0, tslib_1.__importDefault)(require("./roots"));
|
|
7
|
+
const paths_1 = (0, tslib_1.__importDefault)(require("./paths"));
|
|
8
|
+
const html_1 = (0, tslib_1.__importDefault)(require("./html"));
|
|
9
|
+
const styles_1 = (0, tslib_1.__importDefault)(require("./styles"));
|
|
10
|
+
const scripts_1 = (0, tslib_1.__importDefault)(require("./scripts"));
|
|
11
|
+
const images_1 = (0, tslib_1.__importDefault)(require("./images"));
|
|
12
|
+
const extras_1 = (0, tslib_1.__importDefault)(require("./extras"));
|
|
13
|
+
const assets_1 = (0, tslib_1.__importDefault)(require("./assets"));
|
|
14
|
+
const server_1 = (0, tslib_1.__importDefault)(require("./server"));
|
|
15
|
+
const ftp_1 = (0, tslib_1.__importDefault)(require("./ftp"));
|
|
16
|
+
const pwa_1 = (0, tslib_1.__importDefault)(require("./pwa"));
|
|
17
|
+
const logs_1 = (0, tslib_1.__importDefault)(require("./logs"));
|
|
18
18
|
var LogLevel;
|
|
19
19
|
(function (LogLevel) {
|
|
20
20
|
LogLevel[LogLevel["Trace"] = 0] = "Trace";
|
|
@@ -56,5 +56,4 @@ BalmJS.LogLevel = LogLevel;
|
|
|
56
56
|
BalmJS.Bundler = Bundler;
|
|
57
57
|
BalmJS.vendors = vendors;
|
|
58
58
|
BalmJS.entries = [];
|
|
59
|
-
BalmJS.useCache = false;
|
|
60
59
|
exports.default = config;
|
package/tslib/config/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const package_json_1 = tslib_1.__importDefault(require("../../package.json"));
|
|
4
|
+
const package_json_1 = (0, tslib_1.__importDefault)(require("../../package.json"));
|
|
5
5
|
exports.default = package_json_1.default.version;
|
package/tslib/hello.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const events_1 = require("events");
|
|
5
|
-
const cache_core_1 = tslib_1.__importDefault(require("./utilities/cache-core"));
|
|
5
|
+
const cache_core_1 = (0, tslib_1.__importDefault)(require("./utilities/cache-core"));
|
|
6
6
|
global.BalmJS = {
|
|
7
7
|
emitter: new events_1.EventEmitter()
|
|
8
8
|
};
|
|
9
9
|
BalmJS.loading = true;
|
|
10
|
-
cache_core_1.default();
|
|
10
|
+
(0, cache_core_1.default)();
|
package/tslib/hooks/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const maker_1 = tslib_1.__importDefault(require("./maker"));
|
|
4
|
+
const maker_1 = (0, tslib_1.__importDefault)(require("./maker"));
|
|
5
5
|
class BaseHooks {
|
|
6
6
|
get env() {
|
|
7
7
|
return BalmJS.config.env;
|
package/tslib/index.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.version = exports.Balm = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const version_1 = tslib_1.__importDefault(require("./config/version"));
|
|
5
|
+
const version_1 = (0, tslib_1.__importDefault)(require("./config/version"));
|
|
6
6
|
exports.version = version_1.default;
|
|
7
7
|
require("./hello");
|
|
8
|
-
const balm_1 = tslib_1.__importDefault(require("./balm"));
|
|
8
|
+
const balm_1 = (0, tslib_1.__importDefault)(require("./balm"));
|
|
9
9
|
exports.Balm = balm_1.default;
|
|
10
10
|
const balm = new balm_1.default();
|
|
11
11
|
exports.default = balm;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const webpack_1 = tslib_1.__importDefault(require("./webpack"));
|
|
5
|
-
const proxy_1 = tslib_1.__importDefault(require("./proxy"));
|
|
6
|
-
const history_1 = tslib_1.__importDefault(require("./history"));
|
|
4
|
+
const webpack_1 = (0, tslib_1.__importDefault)(require("./webpack"));
|
|
5
|
+
const proxy_1 = (0, tslib_1.__importDefault)(require("./proxy"));
|
|
6
|
+
const history_1 = (0, tslib_1.__importDefault)(require("./history"));
|
|
7
7
|
function getMiddlewares() {
|
|
8
8
|
const canOverride = BalmJS.config.server.middlewares.every((middleware) => BalmJS.utils.isFunction(middleware) || BalmJS.utils.isObject(middleware));
|
|
9
9
|
if (!canOverride) {
|
|
@@ -11,10 +11,10 @@ function getMiddlewares() {
|
|
|
11
11
|
}
|
|
12
12
|
return [
|
|
13
13
|
...(BalmJS.config.scripts.bundler === BalmJS.Bundler.webpack
|
|
14
|
-
? webpack_1.default()
|
|
14
|
+
? (0, webpack_1.default)()
|
|
15
15
|
: []),
|
|
16
|
-
...proxy_1.default(),
|
|
17
|
-
...history_1.default(),
|
|
16
|
+
...(0, proxy_1.default)(),
|
|
17
|
+
...(0, history_1.default)(),
|
|
18
18
|
...(canOverride ? BalmJS.config.server.middlewares : [])
|
|
19
19
|
];
|
|
20
20
|
}
|