@unocss/webpack 0.37.3 → 0.38.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 CHANGED
@@ -9,12 +9,12 @@ Currently, this plugin only supports [the `global` mode](https://github.com/unoc
9
9
  ## Installation
10
10
 
11
11
  ```bash
12
- npm i -D @unocss/webpack
12
+ npm i -D unocss @unocss/webpack
13
13
  ```
14
14
 
15
15
  ```ts
16
16
  // webpack.config.js
17
- const UnoCSS = require('@unocss/webpack').default
17
+ const UnoCSS = require('unocss/webpack').default
18
18
 
19
19
  module.exports = {
20
20
  plugins: [
package/dist/index.cjs CHANGED
@@ -67,6 +67,15 @@ function createContext(configOrPath, defaults = {}, extraConfigSources = [], res
67
67
  tokens.clear();
68
68
  await Promise.all(modules.map((code, id) => uno.applyExtractors(code, id, tokens)));
69
69
  invalidate();
70
+ const presets = /* @__PURE__ */ new Set();
71
+ uno.config.presets.forEach((i) => {
72
+ if (!i.name)
73
+ return;
74
+ if (presets.has(i.name))
75
+ console.warn(`[unocss] duplication of preset ${i.name} found, there might be something wrong with your config.`);
76
+ else
77
+ presets.add(i.name);
78
+ });
70
79
  return result;
71
80
  }
72
81
  async function updateRoot(newRoot) {
package/dist/index.d.ts CHANGED
@@ -4,6 +4,6 @@ import { UserConfig, UserConfigDefaults } from '@unocss/core';
4
4
  interface WebpackPluginOptions<Theme extends {} = {}> extends UserConfig<Theme> {
5
5
  }
6
6
  declare function defineConfig<Theme extends {}>(config: WebpackPluginOptions<Theme>): WebpackPluginOptions<Theme>;
7
- declare function WebpackPlugin(configOrPath?: WebpackPluginOptions | string, defaults?: UserConfigDefaults): webpack.WebpackPluginInstance;
7
+ declare function WebpackPlugin<Theme extends {}>(configOrPath?: WebpackPluginOptions<Theme> | string, defaults?: UserConfigDefaults): webpack.WebpackPluginInstance;
8
8
 
9
9
  export { WebpackPluginOptions, WebpackPlugin as default, defineConfig };
package/dist/index.mjs CHANGED
@@ -59,6 +59,15 @@ function createContext(configOrPath, defaults = {}, extraConfigSources = [], res
59
59
  tokens.clear();
60
60
  await Promise.all(modules.map((code, id) => uno.applyExtractors(code, id, tokens)));
61
61
  invalidate();
62
+ const presets = /* @__PURE__ */ new Set();
63
+ uno.config.presets.forEach((i) => {
64
+ if (!i.name)
65
+ return;
66
+ if (presets.has(i.name))
67
+ console.warn(`[unocss] duplication of preset ${i.name} found, there might be something wrong with your config.`);
68
+ else
69
+ presets.add(i.name);
70
+ });
62
71
  return result;
63
72
  }
64
73
  async function updateRoot(newRoot) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/webpack",
3
- "version": "0.37.3",
3
+ "version": "0.38.1",
4
4
  "description": "The Webpack plugin for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -37,8 +37,8 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@rollup/pluginutils": "^4.2.1",
40
- "@unocss/config": "0.37.3",
41
- "@unocss/core": "0.37.3",
40
+ "@unocss/config": "0.38.1",
41
+ "@unocss/core": "0.38.1",
42
42
  "unplugin": "^0.6.3",
43
43
  "webpack-sources": "^3.2.3"
44
44
  },