@unocss/webpack 0.45.29 → 0.46.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
@@ -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$/, /\.vue\?vue/, /\.svelte$/, /\.[jt]sx$/, /\.mdx?$/, /\.astro$/, /\.elm$/, /\.html$/];
25
+ const defaultInclude = [/\.(vue|svelte|[jt]sx|mdx?|astro|elm|html)($|\?)/];
26
26
 
27
27
  function createContext(configOrPath, defaults = {}, extraConfigSources = [], resolveConfigResult = () => {
28
28
  }) {
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$/, /\.vue\?vue/, /\.svelte$/, /\.[jt]sx$/, /\.mdx?$/, /\.astro$/, /\.elm$/, /\.html$/];
15
+ const defaultInclude = [/\.(vue|svelte|[jt]sx|mdx?|astro|elm|html)($|\?)/];
16
16
 
17
17
  function createContext(configOrPath, defaults = {}, extraConfigSources = [], resolveConfigResult = () => {
18
18
  }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/webpack",
3
- "version": "0.45.29",
3
+ "version": "0.46.0",
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": "^4.2.1",
41
- "@unocss/config": "0.45.29",
42
- "@unocss/core": "0.45.29",
43
- "magic-string": "^0.26.6",
44
- "unplugin": "^0.9.6",
40
+ "@rollup/pluginutils": "^5.0.1",
41
+ "@unocss/config": "0.46.0",
42
+ "@unocss/core": "0.46.0",
43
+ "magic-string": "^0.26.7",
44
+ "unplugin": "^0.10.0",
45
45
  "webpack-sources": "^3.2.3"
46
46
  },
47
47
  "devDependencies": {