@unocss/webpack 0.50.8 → 0.51.1
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 -40
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,47 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
The Webpack plugin for UnoCSS.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Documentation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## Installation
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm i -D unocss @unocss/webpack
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
// webpack.config.js
|
|
17
|
-
const UnoCSS = require('@unocss/webpack').default
|
|
18
|
-
|
|
19
|
-
module.exports = {
|
|
20
|
-
plugins: [
|
|
21
|
-
UnoCSS({ /* options */ }),
|
|
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
|
-
},
|
|
33
|
-
}
|
|
34
|
-
```
|
|
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
|
-
|
|
38
|
-
Add `uno.css` to your main entry:
|
|
39
|
-
|
|
40
|
-
```ts
|
|
41
|
-
// main.ts
|
|
42
|
-
import 'uno.css'
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
Or you can have the config file in `uno.config.ts` or `uno.config.ts`.
|
|
7
|
+
Please refer to the [documentation](https://unocss.dev/integrations/webpack).
|
|
46
8
|
|
|
47
9
|
## License
|
|
48
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/webpack",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.1",
|
|
4
4
|
"description": "The Webpack plugin for UnoCSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"magic-string": "^0.30.0",
|
|
44
44
|
"unplugin": "^1.3.1",
|
|
45
45
|
"webpack-sources": "^3.2.3",
|
|
46
|
-
"@unocss/config": "0.
|
|
47
|
-
"@unocss/core": "0.
|
|
46
|
+
"@unocss/config": "0.51.1",
|
|
47
|
+
"@unocss/core": "0.51.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/webpack": "^5.28.1",
|