balm-core 3.30.0 → 3.31.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/bootstrap/index.js +1 -1
- package/lib/bundler/esbuild/transform.js +77 -79
- package/lib/bundler/rollup/build.js +66 -68
- package/lib/bundler/rollup/index.js +68 -70
- package/lib/bundler/webpack/config/common.js +1 -1
- package/lib/bundler/webpack/rules/css.js +5 -1
- package/lib/config/index.js +6 -6
- package/lib/config/styles.js +2 -2
- package/lib/plugins/imagemin.js +34 -36
- package/lib/plugins/jsmin.js +35 -37
- package/lib/plugins/postcss-plugins.js +5 -3
- package/lib/tasks/private/clean.js +27 -29
- package/lib/tasks/private/end.js +14 -16
- package/lib/tasks/private/extra.js +1 -1
- package/lib/tasks/private/image.js +1 -1
- package/lib/tasks/private/modernizr.js +26 -28
- package/lib/tasks/private/sprite.js +2 -2
- package/lib/tasks/private/start.js +13 -15
- package/lib/tasks/public/pwa.js +53 -55
- package/lib/tasks/public/remove.js +32 -34
- package/lib/tasks/public/rollup.js +9 -11
- package/lib/utilities/file.js +1 -1
- package/package.json +7 -5
- package/tslib/bundler/webpack/rules/css.js +4 -1
- package/tslib/config/styles.js +2 -2
- package/tslib/plugins/postcss-plugins.js +7 -4
|
@@ -28,17 +28,15 @@ var RollupTask = /*#__PURE__*/function (_BalmJS$BalmTask) {
|
|
|
28
28
|
var balmBundler = /*#__PURE__*/function () {
|
|
29
29
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(callback) {
|
|
30
30
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
31
|
-
while (1) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return _context.stop();
|
|
41
|
-
}
|
|
31
|
+
while (1) switch (_context.prev = _context.next) {
|
|
32
|
+
case 0:
|
|
33
|
+
_context.next = 2;
|
|
34
|
+
return (0, _rollup["default"])(input, output);
|
|
35
|
+
case 2:
|
|
36
|
+
callback();
|
|
37
|
+
case 3:
|
|
38
|
+
case "end":
|
|
39
|
+
return _context.stop();
|
|
42
40
|
}
|
|
43
41
|
}, _callee);
|
|
44
42
|
}));
|
package/lib/utilities/file.js
CHANGED
|
@@ -13,7 +13,7 @@ var _publicUrl = _interopRequireDefault(require("./public-url"));
|
|
|
13
13
|
var _constants = require("../config/constants");
|
|
14
14
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
15
15
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
16
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
17
17
|
// Make sure any symlinks in the project folder are resolved
|
|
18
18
|
var appDirectory = _fs["default"].realpathSync(process.cwd());
|
|
19
19
|
var resolveApp = function resolveApp(relativePath) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "balm-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.31.0",
|
|
4
4
|
"description": "BalmJS compiler core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"balm",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"async": "^3.2.4",
|
|
45
45
|
"autoprefixer": "9",
|
|
46
46
|
"babel-loader": "8",
|
|
47
|
-
"browser-sync": "^2.
|
|
47
|
+
"browser-sync": "^2.29.0",
|
|
48
48
|
"connect-history-api-fallback": "^2.0.0",
|
|
49
49
|
"css-loader": "5",
|
|
50
50
|
"cssnano": "4",
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
"parents": "^1.0.1",
|
|
75
75
|
"plugin-error": "^2.0.1",
|
|
76
76
|
"postcss": "7",
|
|
77
|
+
"postcss-flexbugs-fixes": "4",
|
|
77
78
|
"postcss-import": "12",
|
|
78
79
|
"postcss-load-config": "2",
|
|
79
80
|
"postcss-loader": "4",
|
|
@@ -89,7 +90,8 @@
|
|
|
89
90
|
"ssh2": "0.8.9",
|
|
90
91
|
"strip-ansi": "6",
|
|
91
92
|
"style-loader": "2",
|
|
92
|
-
"
|
|
93
|
+
"tailwindcss": "npm:@tailwindcss/postcss7-compat",
|
|
94
|
+
"terser": "^5.16.6",
|
|
93
95
|
"terser-webpack-plugin": "4",
|
|
94
96
|
"through2": "^4.0.2",
|
|
95
97
|
"through2-concurrent": "^2.0.0",
|
|
@@ -97,7 +99,7 @@
|
|
|
97
99
|
"url-loader": "^4.1.1",
|
|
98
100
|
"vinyl-sourcemaps-apply": "^0.2.1",
|
|
99
101
|
"webpack": "4",
|
|
100
|
-
"webpack-bundle-analyzer": "^4.
|
|
102
|
+
"webpack-bundle-analyzer": "^4.8.0",
|
|
101
103
|
"webpack-dev-middleware": "3",
|
|
102
104
|
"webpack-hot-middleware": "^2.25.3",
|
|
103
105
|
"webpack-merge": "^5.8.0",
|
|
@@ -117,5 +119,5 @@
|
|
|
117
119
|
"engines": {
|
|
118
120
|
"node": ">=10.13.0"
|
|
119
121
|
},
|
|
120
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "c8dba4cdbc84c9ea0f7e2912fb3f3b4b04b01caa"
|
|
121
123
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
3
5
|
const regex_1 = require("../config/regex");
|
|
6
|
+
const useTailwind = fs_1.default.existsSync(path.join(BalmJS.config.workspace, 'tailwind.config.js'));
|
|
4
7
|
function cssLoader() {
|
|
5
8
|
let styleLoader = {
|
|
6
9
|
loader: require.resolve('style-loader'),
|
|
@@ -48,7 +51,7 @@ function cssLoader() {
|
|
|
48
51
|
loader: require.resolve('postcss-loader'),
|
|
49
52
|
options: Object.assign({
|
|
50
53
|
postcssOptions: {
|
|
51
|
-
plugins: BalmJS.plugins.postcssPlugins(true)
|
|
54
|
+
plugins: BalmJS.plugins.postcssPlugins(true, useTailwind)
|
|
52
55
|
},
|
|
53
56
|
sourceMap
|
|
54
57
|
}, BalmJS.config.scripts.postcssLoaderOptions)
|
package/tslib/config/styles.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function getDefaultPostcssPlugins(isPostCSS = false) {
|
|
4
|
-
const postcssPresetEnv = require('postcss-preset-env');
|
|
3
|
+
function getDefaultPostcssPlugins(isPostCSS = false, useTailwind = false) {
|
|
5
4
|
const atImport = require('postcss-import');
|
|
5
|
+
const postcssFlexbugsFixes = require('postcss-flexbugs-fixes');
|
|
6
|
+
const postcssPresetEnv = require('postcss-preset-env');
|
|
6
7
|
const autoprefixer = require('autoprefixer');
|
|
7
8
|
const cssnano = require('cssnano');
|
|
8
9
|
const defaultPostcssPlugins = isPostCSS || BalmJS.config.styles.extname === 'css'
|
|
9
10
|
? [
|
|
10
|
-
|
|
11
|
-
atImport({ path: BalmJS.file.stylePaths })
|
|
11
|
+
...(useTailwind ? ['tailwindcss'] : []),
|
|
12
|
+
atImport({ path: BalmJS.file.stylePaths }),
|
|
13
|
+
postcssFlexbugsFixes(),
|
|
14
|
+
postcssPresetEnv(BalmJS.config.styles.postcssEnvOptions)
|
|
12
15
|
]
|
|
13
16
|
: [];
|
|
14
17
|
const cssnanoPlugin = BalmJS.config.env.isProd || BalmJS.config.styles.minify
|