@best-shot/preset-style 0.12.7 → 0.12.9
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 -18
- package/lib/apply-stylesheet.mjs +5 -1
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -18,9 +18,11 @@ This preset offer the following features:
|
|
|
18
18
|
- [Interoperable CSS] support
|
|
19
19
|
- [Less] / [Sass] syntax support
|
|
20
20
|
- [PostCSS] support
|
|
21
|
+
- Use [tailwindcss] when it installed
|
|
21
22
|
- Use [postcss-preset-evergreen] by default(including [Autoprefixer])
|
|
22
23
|
- Use [cssnano] in production mode
|
|
23
24
|
|
|
25
|
+
[tailwindcss]: https://tailwindcss.com/
|
|
24
26
|
[interoperable css]: https://github.com/css-modules/icss
|
|
25
27
|
[css modules]: https://github.com/css-modules/css-modules
|
|
26
28
|
[cssnano]: https://cssnano.co/
|
|
@@ -69,24 +71,6 @@ Use CSS Modules in Vue.js. [Learn more](https://vue-loader.vuejs.org/guide/css-m
|
|
|
69
71
|
|
|
70
72
|
### Load custom `postcss` config
|
|
71
73
|
|
|
72
|
-
Disable internal options:
|
|
73
|
-
|
|
74
|
-
```mjs
|
|
75
|
-
// example: .best-shot/config.mjs
|
|
76
|
-
export default {
|
|
77
|
-
webpackChain(config) {
|
|
78
|
-
config.module
|
|
79
|
-
.rule('style')
|
|
80
|
-
.rule('postcss')
|
|
81
|
-
.use('postcss-loader')
|
|
82
|
-
.tap((options) => ({
|
|
83
|
-
...options,
|
|
84
|
-
postcssOptions: {}
|
|
85
|
-
}));
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
```
|
|
89
|
-
|
|
90
74
|
Write your config in any way. See <https://github.com/postcss/postcss-load-config>
|
|
91
75
|
|
|
92
76
|
```cjs
|
package/lib/apply-stylesheet.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import extToRegexp from 'ext-to-regexp';
|
|
2
|
+
import { haveLocalDependencies } from 'settingz';
|
|
2
3
|
import slashToRegexp from 'slash-to-regexp';
|
|
3
4
|
|
|
4
5
|
const auto = (resourcePath, resourceQuery) =>
|
|
@@ -40,7 +41,10 @@ export async function applyStylesheet(chain) {
|
|
|
40
41
|
.loader('postcss-loader')
|
|
41
42
|
.options({
|
|
42
43
|
postcssOptions: {
|
|
43
|
-
plugins: [
|
|
44
|
+
plugins: [
|
|
45
|
+
haveLocalDependencies('tailwindcss') ? 'tailwindcss' : undefined,
|
|
46
|
+
'postcss-preset-evergreen',
|
|
47
|
+
].filter(Boolean),
|
|
44
48
|
},
|
|
45
49
|
});
|
|
46
50
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@best-shot/preset-style",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.9",
|
|
4
4
|
"description": "A `best-shot` preset for stylesheet",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"type": "module",
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"css-loader": "^7.1.1",
|
|
39
|
-
"css-minimizer-webpack-plugin": "^
|
|
40
|
-
"cssnano": "^
|
|
39
|
+
"css-minimizer-webpack-plugin": "^7.0.0",
|
|
40
|
+
"cssnano": "^7.0.1",
|
|
41
41
|
"ext-to-regexp": "^0.1.0",
|
|
42
42
|
"less": "^4.2.0",
|
|
43
43
|
"less-loader": "^12.2.0",
|
|
@@ -46,13 +46,14 @@
|
|
|
46
46
|
"postcss-loader": "^8.1.1",
|
|
47
47
|
"postcss-preset-evergreen": "^0.5.9",
|
|
48
48
|
"resolve-url-loader": "^5.0.0",
|
|
49
|
-
"sass": "^1.
|
|
49
|
+
"sass": "^1.77.1",
|
|
50
50
|
"sass-loader": "^14.2.1",
|
|
51
|
+
"settingz": "^0.2.0",
|
|
51
52
|
"slash-to-regexp": "^0.0.4",
|
|
52
53
|
"style-loader": "^4.0.0"
|
|
53
54
|
},
|
|
54
55
|
"peerDependencies": {
|
|
55
|
-
"@best-shot/core": "^0.9.
|
|
56
|
+
"@best-shot/core": "^0.9.11"
|
|
56
57
|
},
|
|
57
58
|
"engines": {
|
|
58
59
|
"node": ">=20.0.0 || ^18.12.0"
|