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 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/next.svg
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/next.svg
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)
@@ -30,10 +30,10 @@ const lessOptions = {};
30
30
  * @reference https://github.com/csstools/postcss-preset-env#options
31
31
  */
32
32
  const postcssEnvOptions = {
33
- stage: 0,
34
33
  autoprefixer: {
35
34
  flexbox: 'no-2009'
36
- }
35
+ },
36
+ stage: 3
37
37
  };
38
38
  /**
39
39
  * PostCSS plugins
@@ -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.18.0",
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.0",
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.0",
49
+ "browser-sync": "^2.29.3",
50
50
  "connect-history-api-fallback": "^2.0.0",
51
- "css-loader": "^6.7.3",
52
- "css-minimizer-webpack-plugin": "^4.2.2",
53
- "cssnano": "^5.1.15",
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.0",
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.5",
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.21",
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.1.0",
84
- "postcss-preset-env": "^8.0.1",
83
+ "postcss-loader": "7.3.0",
84
+ "postcss-preset-env": "^8.4.1",
85
85
  "pretty-bytes": "^6.1.0",
86
- "readable-stream": "^4.3.0",
86
+ "readable-stream": "^4.4.0",
87
87
  "replace-ext": "^2.0.0",
88
- "rollup": "^3.20.0",
89
- "sass": "^1.59.3",
90
- "sass-loader": "^13.2.1",
91
- "ssh2": "^1.11.0",
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.2",
94
- "terser": "^5.16.6",
95
- "terser-webpack-plugin": "^5.3.7",
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.0",
99
+ "tslib": "^2.5.2",
99
100
  "vinyl-sourcemaps-apply": "^0.2.1",
100
- "webpack": "^5.76.2",
101
+ "webpack": "^5.83.1",
101
102
  "webpack-bundle-analyzer": "^4.8.0",
102
- "webpack-dev-middleware": "^6.0.2",
103
+ "webpack-dev-middleware": "^6.1.1",
103
104
  "webpack-hot-middleware": "^2.25.3",
104
- "webpack-merge": "^5.8.0",
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": "6d1a813df5ac474dfece8749cd69a17930cd280d"
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)
@@ -10,10 +10,10 @@ const options = {
10
10
  const sassOptions = {};
11
11
  const lessOptions = {};
12
12
  const postcssEnvOptions = {
13
- stage: 0,
14
13
  autoprefixer: {
15
14
  flexbox: 'no-2009'
16
- }
15
+ },
16
+ stage: 3
17
17
  };
18
18
  const postcssPlugins = [];
19
19
  const imageBasePath = '../';
@@ -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)