balm-core 4.18.0 → 4.20.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/README.md +2 -2
- package/lib/bundler/webpack/rules/css.js +5 -1
- package/lib/config/styles.js +2 -2
- package/lib/plugins/postcss-plugins.js +2 -2
- package/package.json +25 -24
- package/tslib/bundler/webpack/rules/css.js +3 -1
- package/tslib/config/styles.js +2 -2
- package/tslib/plugins/postcss-plugins.js +2 -1
package/README.md
CHANGED
|
@@ -172,9 +172,9 @@ We'd love for you to contribute and make BalmJS even better than it is today! Pl
|
|
|
172
172
|
|
|
173
173
|
© 2016-present, [Elf-mousE](http://elf-mouse.me/)
|
|
174
174
|
|
|
175
|
-
[balm-core-image]: https://img.shields.io/npm/v/balm-core
|
|
175
|
+
[balm-core-image]: https://img.shields.io/npm/v/balm-core.svg
|
|
176
176
|
[balm-core-url]: https://npmjs.org/package/balm-core
|
|
177
|
-
[balm-image]: https://img.shields.io/npm/v/balm
|
|
177
|
+
[balm-image]: https://img.shields.io/npm/v/balm.svg
|
|
178
178
|
[balm-url]: https://npmjs.org/package/balm
|
|
179
179
|
[license-image]: https://img.shields.io/npm/l/balm-core.svg?sanitize=true
|
|
180
180
|
[license-url]: https://www.npmjs.com/package/balm-core
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
1
2
|
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
2
3
|
import { cssRegex, cssModuleRegex, sassRegex, sassModuleRegex } from '../config/regex.js';
|
|
4
|
+
// Check if Tailwind config exists
|
|
5
|
+
const useTailwind = fs.existsSync(node.path.join(BalmJS.config.workspace, 'tailwind.config.js'));
|
|
6
|
+
|
|
3
7
|
// common function to get style loaders
|
|
4
8
|
function getStyleLoaders(styleLoader, cssOptions, preProcessor = '', sassOptions = {}) {
|
|
5
9
|
const {
|
|
@@ -17,7 +21,7 @@ function getStyleLoaders(styleLoader, cssOptions, preProcessor = '', sassOptions
|
|
|
17
21
|
loader: requireModule.resolve('postcss-loader'),
|
|
18
22
|
options: Object.assign({
|
|
19
23
|
postcssOptions: {
|
|
20
|
-
plugins: BalmJS.plugins.postcssPlugins(true)
|
|
24
|
+
plugins: BalmJS.plugins.postcssPlugins(true, useTailwind)
|
|
21
25
|
},
|
|
22
26
|
sourceMap
|
|
23
27
|
}, BalmJS.config.scripts.postcssLoaderOptions)
|
package/lib/config/styles.js
CHANGED
|
@@ -3,8 +3,8 @@ import postcssFlexbugsFixes from 'postcss-flexbugs-fixes';
|
|
|
3
3
|
import postcssPresetEnv from 'postcss-preset-env';
|
|
4
4
|
import autoprefixer from 'autoprefixer';
|
|
5
5
|
import cssnano from 'cssnano';
|
|
6
|
-
function getDefaultPostcssPlugins(isPostCSS = false) {
|
|
7
|
-
const defaultPostcssPlugins = isPostCSS || BalmJS.config.styles.extname === 'css' ? [atImport({
|
|
6
|
+
function getDefaultPostcssPlugins(isPostCSS = false, useTailwind = false) {
|
|
7
|
+
const defaultPostcssPlugins = isPostCSS || BalmJS.config.styles.extname === 'css' ? [...(useTailwind ? ['tailwindcss'] : []), atImport({
|
|
8
8
|
path: BalmJS.file.stylePaths
|
|
9
9
|
}), postcssFlexbugsFixes(), postcssPresetEnv(BalmJS.config.styles.postcssEnvOptions)] : [];
|
|
10
10
|
const cssnanoPlugin = BalmJS.config.env.isProd || BalmJS.config.styles.minify ? [cssnano(BalmJS.config.styles.options)] : [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "balm-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.20.0",
|
|
4
4
|
"description": "BalmJS compiler core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"balm",
|
|
@@ -41,16 +41,16 @@
|
|
|
41
41
|
"directory": "packages/balm-core"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@rollup/plugin-terser": "^0.4.
|
|
44
|
+
"@rollup/plugin-terser": "^0.4.3",
|
|
45
45
|
"ansi-colors": "^4.1.3",
|
|
46
46
|
"async": "^3.2.4",
|
|
47
47
|
"autoprefixer": "^10.4.14",
|
|
48
48
|
"babel-loader": "^9.1.2",
|
|
49
|
-
"browser-sync": "^2.29.
|
|
49
|
+
"browser-sync": "^2.29.3",
|
|
50
50
|
"connect-history-api-fallback": "^2.0.0",
|
|
51
|
-
"css-loader": "^6.7.
|
|
52
|
-
"css-minimizer-webpack-plugin": "^
|
|
53
|
-
"cssnano": "^
|
|
51
|
+
"css-loader": "^6.7.4",
|
|
52
|
+
"css-minimizer-webpack-plugin": "^5.0.0",
|
|
53
|
+
"cssnano": "^6.0.1",
|
|
54
54
|
"del": "^7.0.0",
|
|
55
55
|
"dotenv": "^16.0.3",
|
|
56
56
|
"dotenv-expand": "^10.0.0",
|
|
@@ -67,41 +67,42 @@
|
|
|
67
67
|
"gulp.spritesmith": "^6.13.0",
|
|
68
68
|
"html-loader": "^4.2.0",
|
|
69
69
|
"html-minifier": "^4.0.0",
|
|
70
|
-
"html-webpack-plugin": "^5.5.
|
|
70
|
+
"html-webpack-plugin": "^5.5.1",
|
|
71
71
|
"http-proxy-middleware": "^2.0.6",
|
|
72
72
|
"imagemin": "^8.0.1",
|
|
73
73
|
"istextorbinary": "^6.0.0",
|
|
74
74
|
"less": "^4.1.3",
|
|
75
|
-
"mini-css-extract-plugin": "^2.7.
|
|
75
|
+
"mini-css-extract-plugin": "^2.7.6",
|
|
76
76
|
"modernizr": "^3.12.0",
|
|
77
77
|
"parents": "^1.0.1",
|
|
78
78
|
"plugin-error": "^2.0.1",
|
|
79
|
-
"postcss": "^8.4.
|
|
79
|
+
"postcss": "^8.4.23",
|
|
80
80
|
"postcss-flexbugs-fixes": "^5.0.2",
|
|
81
81
|
"postcss-import": "^15.1.0",
|
|
82
82
|
"postcss-load-config": "^4.0.1",
|
|
83
|
-
"postcss-loader": "7.
|
|
84
|
-
"postcss-preset-env": "^8.
|
|
83
|
+
"postcss-loader": "7.3.0",
|
|
84
|
+
"postcss-preset-env": "^8.4.1",
|
|
85
85
|
"pretty-bytes": "^6.1.0",
|
|
86
|
-
"readable-stream": "^4.
|
|
86
|
+
"readable-stream": "^4.4.0",
|
|
87
87
|
"replace-ext": "^2.0.0",
|
|
88
|
-
"rollup": "^3.
|
|
89
|
-
"sass": "^1.
|
|
90
|
-
"sass-loader": "^13.
|
|
91
|
-
"ssh2": "^1.
|
|
88
|
+
"rollup": "^3.23.0",
|
|
89
|
+
"sass": "^1.62.1",
|
|
90
|
+
"sass-loader": "^13.3.0",
|
|
91
|
+
"ssh2": "^1.13.0",
|
|
92
92
|
"strip-ansi": "^7.0.1",
|
|
93
|
-
"style-loader": "^3.3.
|
|
94
|
-
"
|
|
95
|
-
"terser
|
|
93
|
+
"style-loader": "^3.3.3",
|
|
94
|
+
"tailwindcss": "^3.3.2",
|
|
95
|
+
"terser": "^5.17.6",
|
|
96
|
+
"terser-webpack-plugin": "^5.3.9",
|
|
96
97
|
"through2": "^4.0.2",
|
|
97
98
|
"through2-concurrent": "^2.0.0",
|
|
98
|
-
"tslib": "^2.5.
|
|
99
|
+
"tslib": "^2.5.2",
|
|
99
100
|
"vinyl-sourcemaps-apply": "^0.2.1",
|
|
100
|
-
"webpack": "^5.
|
|
101
|
+
"webpack": "^5.83.1",
|
|
101
102
|
"webpack-bundle-analyzer": "^4.8.0",
|
|
102
|
-
"webpack-dev-middleware": "^6.
|
|
103
|
+
"webpack-dev-middleware": "^6.1.1",
|
|
103
104
|
"webpack-hot-middleware": "^2.25.3",
|
|
104
|
-
"webpack-merge": "^5.
|
|
105
|
+
"webpack-merge": "^5.9.0",
|
|
105
106
|
"workbox-build": "^6.5.4"
|
|
106
107
|
},
|
|
107
108
|
"devDependencies": {
|
|
@@ -120,5 +121,5 @@
|
|
|
120
121
|
"engines": {
|
|
121
122
|
"node": ">=16"
|
|
122
123
|
},
|
|
123
|
-
"gitHead": "
|
|
124
|
+
"gitHead": "fbfeddf07dc8e7bdbae235ba7123e518db069597"
|
|
124
125
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
1
2
|
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
2
3
|
import { cssRegex, cssModuleRegex, sassRegex, sassModuleRegex } from '../config/regex.js';
|
|
4
|
+
const useTailwind = fs.existsSync(node.path.join(BalmJS.config.workspace, 'tailwind.config.js'));
|
|
3
5
|
function getStyleLoaders(styleLoader, cssOptions, preProcessor = '', sassOptions = {}) {
|
|
4
6
|
const { sourceMap } = cssOptions;
|
|
5
7
|
const loaders = [
|
|
@@ -19,7 +21,7 @@ function getStyleLoaders(styleLoader, cssOptions, preProcessor = '', sassOptions
|
|
|
19
21
|
loader: requireModule.resolve('postcss-loader'),
|
|
20
22
|
options: Object.assign({
|
|
21
23
|
postcssOptions: {
|
|
22
|
-
plugins: BalmJS.plugins.postcssPlugins(true)
|
|
24
|
+
plugins: BalmJS.plugins.postcssPlugins(true, useTailwind)
|
|
23
25
|
},
|
|
24
26
|
sourceMap
|
|
25
27
|
}, BalmJS.config.scripts.postcssLoaderOptions)
|
package/tslib/config/styles.js
CHANGED
|
@@ -3,9 +3,10 @@ import postcssFlexbugsFixes from 'postcss-flexbugs-fixes';
|
|
|
3
3
|
import postcssPresetEnv from 'postcss-preset-env';
|
|
4
4
|
import autoprefixer from 'autoprefixer';
|
|
5
5
|
import cssnano from 'cssnano';
|
|
6
|
-
function getDefaultPostcssPlugins(isPostCSS = false) {
|
|
6
|
+
function getDefaultPostcssPlugins(isPostCSS = false, useTailwind = false) {
|
|
7
7
|
const defaultPostcssPlugins = isPostCSS || BalmJS.config.styles.extname === 'css'
|
|
8
8
|
? [
|
|
9
|
+
...(useTailwind ? ['tailwindcss'] : []),
|
|
9
10
|
atImport({ path: BalmJS.file.stylePaths }),
|
|
10
11
|
postcssFlexbugsFixes(),
|
|
11
12
|
postcssPresetEnv(BalmJS.config.styles.postcssEnvOptions)
|