@unocss/webpack 0.45.28 → 0.45.30
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 +12 -0
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -20,9 +20,21 @@ module.exports = {
|
|
|
20
20
|
plugins: [
|
|
21
21
|
UnoCSS({ /* options */ }),
|
|
22
22
|
],
|
|
23
|
+
// for Webpack 4
|
|
24
|
+
css: {
|
|
25
|
+
extract: {
|
|
26
|
+
filename: '[name].[hash:9].css',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
// for Webpack 5
|
|
30
|
+
optimization: {
|
|
31
|
+
realContentHash: true,
|
|
32
|
+
},
|
|
23
33
|
}
|
|
24
34
|
```
|
|
25
35
|
|
|
36
|
+
> If you are using webpack@4.x, the `optimization.realContentHash` configuration is not supported, And you should use `css.extract.filename` to customize css filename(We use first 9 letter of hashcode instead of contenthash as example). Be aware of this [known issue](https://github.com/unocss/unocss/issues/1728) with bundle and [webpack#9520](https://github.com/webpack/webpack/issues/9520#issuecomment-749534245).
|
|
37
|
+
|
|
26
38
|
Add `uno.css` to your main entry:
|
|
27
39
|
|
|
28
40
|
```ts
|
package/dist/index.cjs
CHANGED
|
@@ -22,7 +22,7 @@ const IGNORE_COMMENT = "@unocss-ignore";
|
|
|
22
22
|
const CSS_PLACEHOLDER = "@unocss-placeholder";
|
|
23
23
|
|
|
24
24
|
const defaultExclude = [core.cssIdRE];
|
|
25
|
-
const defaultInclude = [/\.vue
|
|
25
|
+
const defaultInclude = [/\.(vue|svelte|[jt]sx|mdx?|astro|elm|html)($|\?)/];
|
|
26
26
|
|
|
27
27
|
function createContext(configOrPath, defaults = {}, extraConfigSources = [], resolveConfigResult = () => {
|
|
28
28
|
}) {
|
|
@@ -126,7 +126,8 @@ const VIRTUAL_ENTRY_ALIAS = [
|
|
|
126
126
|
/^(?:virtual:)?uno(?::(.+))?\.css(\?.*)?$/
|
|
127
127
|
];
|
|
128
128
|
const LAYER_MARK_ALL = "__ALL__";
|
|
129
|
-
const RESOLVED_ID_WITH_QUERY_RE =
|
|
129
|
+
const RESOLVED_ID_WITH_QUERY_RE = /[\/\\]__uno(?:(_.*?))?\.css(\?.*)?$/;
|
|
130
|
+
const RESOLVED_ID_RE = /[\/\\]__uno(?:(_.*?))?\.css$/;
|
|
130
131
|
function resolveId(id) {
|
|
131
132
|
if (id.match(RESOLVED_ID_WITH_QUERY_RE))
|
|
132
133
|
return id;
|
|
@@ -137,7 +138,6 @@ function resolveId(id) {
|
|
|
137
138
|
}
|
|
138
139
|
}
|
|
139
140
|
}
|
|
140
|
-
const RESOLVED_ID_RE = /\/__uno(?:(_.*?))?\.css$/;
|
|
141
141
|
function resolveLayer(id) {
|
|
142
142
|
const match = id.match(RESOLVED_ID_RE);
|
|
143
143
|
if (match)
|
package/dist/index.mjs
CHANGED
|
@@ -12,7 +12,7 @@ const IGNORE_COMMENT = "@unocss-ignore";
|
|
|
12
12
|
const CSS_PLACEHOLDER = "@unocss-placeholder";
|
|
13
13
|
|
|
14
14
|
const defaultExclude = [cssIdRE];
|
|
15
|
-
const defaultInclude = [/\.vue
|
|
15
|
+
const defaultInclude = [/\.(vue|svelte|[jt]sx|mdx?|astro|elm|html)($|\?)/];
|
|
16
16
|
|
|
17
17
|
function createContext(configOrPath, defaults = {}, extraConfigSources = [], resolveConfigResult = () => {
|
|
18
18
|
}) {
|
|
@@ -116,7 +116,8 @@ const VIRTUAL_ENTRY_ALIAS = [
|
|
|
116
116
|
/^(?:virtual:)?uno(?::(.+))?\.css(\?.*)?$/
|
|
117
117
|
];
|
|
118
118
|
const LAYER_MARK_ALL = "__ALL__";
|
|
119
|
-
const RESOLVED_ID_WITH_QUERY_RE =
|
|
119
|
+
const RESOLVED_ID_WITH_QUERY_RE = /[\/\\]__uno(?:(_.*?))?\.css(\?.*)?$/;
|
|
120
|
+
const RESOLVED_ID_RE = /[\/\\]__uno(?:(_.*?))?\.css$/;
|
|
120
121
|
function resolveId(id) {
|
|
121
122
|
if (id.match(RESOLVED_ID_WITH_QUERY_RE))
|
|
122
123
|
return id;
|
|
@@ -127,7 +128,6 @@ function resolveId(id) {
|
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
|
-
const RESOLVED_ID_RE = /\/__uno(?:(_.*?))?\.css$/;
|
|
131
131
|
function resolveLayer(id) {
|
|
132
132
|
const match = id.match(RESOLVED_ID_RE);
|
|
133
133
|
if (match)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/webpack",
|
|
3
|
-
"version": "0.45.
|
|
3
|
+
"version": "0.45.30",
|
|
4
4
|
"description": "The Webpack plugin for UnoCSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@ampproject/remapping": "^2.2.0",
|
|
40
|
-
"@rollup/pluginutils": "^
|
|
41
|
-
"@unocss/config": "0.45.
|
|
42
|
-
"@unocss/core": "0.45.
|
|
43
|
-
"magic-string": "^0.26.
|
|
44
|
-
"unplugin": "^0.
|
|
40
|
+
"@rollup/pluginutils": "^5.0.1",
|
|
41
|
+
"@unocss/config": "0.45.30",
|
|
42
|
+
"@unocss/core": "0.45.30",
|
|
43
|
+
"magic-string": "^0.26.7",
|
|
44
|
+
"unplugin": "^0.10.0",
|
|
45
45
|
"webpack-sources": "^3.2.3"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|