@unocss/webpack 0.55.2 → 0.55.3
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/dist/index.cjs +6 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +5 -2
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
const process$1 = require('node:process');
|
|
5
6
|
const unplugin = require('unplugin');
|
|
6
7
|
const WebpackSources = require('webpack-sources');
|
|
7
|
-
const process$1 = require('node:process');
|
|
8
8
|
const pluginutils = require('@rollup/pluginutils');
|
|
9
9
|
const config = require('@unocss/config');
|
|
10
10
|
const core = require('@unocss/core');
|
|
@@ -17,8 +17,8 @@ const node_crypto = require('node:crypto');
|
|
|
17
17
|
|
|
18
18
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
19
19
|
|
|
20
|
-
const WebpackSources__default = /*#__PURE__*/_interopDefaultCompat(WebpackSources);
|
|
21
20
|
const process__default = /*#__PURE__*/_interopDefaultCompat(process$1);
|
|
21
|
+
const WebpackSources__default = /*#__PURE__*/_interopDefaultCompat(WebpackSources);
|
|
22
22
|
const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
23
23
|
const fg__default = /*#__PURE__*/_interopDefaultCompat(fg);
|
|
24
24
|
const MagicString__default = /*#__PURE__*/_interopDefaultCompat(MagicString);
|
|
@@ -307,7 +307,10 @@ function defineConfig(config) {
|
|
|
307
307
|
}
|
|
308
308
|
function WebpackPlugin(configOrPath, defaults) {
|
|
309
309
|
return unplugin.createUnplugin(() => {
|
|
310
|
-
const ctx = createContext(configOrPath,
|
|
310
|
+
const ctx = createContext(configOrPath, {
|
|
311
|
+
envMode: process__default.env.NODE_ENV === "development" ? "dev" : "build",
|
|
312
|
+
...defaults
|
|
313
|
+
});
|
|
311
314
|
const { uno, tokens, filter, extract, onInvalidate, tasks, flushTasks } = ctx;
|
|
312
315
|
let timer;
|
|
313
316
|
onInvalidate(() => {
|
package/dist/index.d.cts
CHANGED
|
@@ -6,4 +6,4 @@ interface WebpackPluginOptions<Theme extends object = object> extends UserConfig
|
|
|
6
6
|
declare function defineConfig<Theme extends object>(config: WebpackPluginOptions<Theme>): WebpackPluginOptions<Theme>;
|
|
7
7
|
declare function WebpackPlugin<Theme extends object>(configOrPath?: WebpackPluginOptions<Theme> | string, defaults?: UserConfigDefaults): webpack.WebpackPluginInstance;
|
|
8
8
|
|
|
9
|
-
export { WebpackPluginOptions, WebpackPlugin as default, defineConfig };
|
|
9
|
+
export { type WebpackPluginOptions, WebpackPlugin as default, defineConfig };
|
package/dist/index.d.mts
CHANGED
|
@@ -6,4 +6,4 @@ interface WebpackPluginOptions<Theme extends object = object> extends UserConfig
|
|
|
6
6
|
declare function defineConfig<Theme extends object>(config: WebpackPluginOptions<Theme>): WebpackPluginOptions<Theme>;
|
|
7
7
|
declare function WebpackPlugin<Theme extends object>(configOrPath?: WebpackPluginOptions<Theme> | string, defaults?: UserConfigDefaults): webpack.WebpackPluginInstance;
|
|
8
8
|
|
|
9
|
-
export { WebpackPluginOptions, WebpackPlugin as default, defineConfig };
|
|
9
|
+
export { type WebpackPluginOptions, WebpackPlugin as default, defineConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ interface WebpackPluginOptions<Theme extends object = object> extends UserConfig
|
|
|
6
6
|
declare function defineConfig<Theme extends object>(config: WebpackPluginOptions<Theme>): WebpackPluginOptions<Theme>;
|
|
7
7
|
declare function WebpackPlugin<Theme extends object>(configOrPath?: WebpackPluginOptions<Theme> | string, defaults?: UserConfigDefaults): webpack.WebpackPluginInstance;
|
|
8
8
|
|
|
9
|
-
export { WebpackPluginOptions, WebpackPlugin as default, defineConfig };
|
|
9
|
+
export { type WebpackPluginOptions, WebpackPlugin as default, defineConfig };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import process$1 from 'node:process';
|
|
1
2
|
import { createUnplugin } from 'unplugin';
|
|
2
3
|
import WebpackSources from 'webpack-sources';
|
|
3
|
-
import process$1 from 'node:process';
|
|
4
4
|
import { createFilter } from '@rollup/pluginutils';
|
|
5
5
|
import { loadConfig } from '@unocss/config';
|
|
6
6
|
import { cssIdRE, createGenerator, BetterMap } from '@unocss/core';
|
|
@@ -294,7 +294,10 @@ function defineConfig(config) {
|
|
|
294
294
|
}
|
|
295
295
|
function WebpackPlugin(configOrPath, defaults) {
|
|
296
296
|
return createUnplugin(() => {
|
|
297
|
-
const ctx = createContext(configOrPath,
|
|
297
|
+
const ctx = createContext(configOrPath, {
|
|
298
|
+
envMode: process$1.env.NODE_ENV === "development" ? "dev" : "build",
|
|
299
|
+
...defaults
|
|
300
|
+
});
|
|
298
301
|
const { uno, tokens, filter, extract, onInvalidate, tasks, flushTasks } = ctx;
|
|
299
302
|
let timer;
|
|
300
303
|
onInvalidate(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/webpack",
|
|
3
|
-
"version": "0.55.
|
|
3
|
+
"version": "0.55.3",
|
|
4
4
|
"description": "The Webpack plugin for UnoCSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"@rollup/pluginutils": "^5.0.3",
|
|
41
41
|
"chokidar": "^3.5.3",
|
|
42
42
|
"fast-glob": "^3.3.1",
|
|
43
|
-
"magic-string": "^0.30.
|
|
43
|
+
"magic-string": "^0.30.3",
|
|
44
44
|
"unplugin": "^1.4.0",
|
|
45
45
|
"webpack-sources": "^3.2.3",
|
|
46
|
-
"@unocss/config": "0.55.
|
|
47
|
-
"@unocss/core": "0.55.
|
|
46
|
+
"@unocss/config": "0.55.3",
|
|
47
|
+
"@unocss/core": "0.55.3"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@types/webpack": "^5.28.
|
|
50
|
+
"@types/webpack": "^5.28.2",
|
|
51
51
|
"@types/webpack-sources": "^3.2.0",
|
|
52
52
|
"webpack": "^5.88.2"
|
|
53
53
|
},
|