@unocss/webpack 66.3.2 → 66.4.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/dist/index.cjs +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +1 -1
- package/dist/rspack.cjs +1 -1
- package/dist/rspack.mjs +1 -1
- package/dist/shared/{webpack.D8KO24In.mjs → webpack.AwO5g8V4.mjs} +5 -20
- package/dist/shared/{webpack.Ba9iFtiV.cjs → webpack.NQTpiUaU.cjs} +4 -19
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -11,6 +11,5 @@ interface WebpackPluginOptions<Theme extends object = object> extends UserConfig
|
|
|
11
11
|
}
|
|
12
12
|
declare function WebpackPlugin<Theme extends object>(configOrPath?: WebpackPluginOptions<Theme> | string, defaults?: UserConfigDefaults): webpack.WebpackPluginInstance;
|
|
13
13
|
|
|
14
|
-
// @ts-ignore
|
|
15
14
|
export = WebpackPlugin;
|
|
16
15
|
export type { WebpackPluginOptions };
|
package/dist/index.d.mts
CHANGED
|
@@ -11,4 +11,5 @@ interface WebpackPluginOptions<Theme extends object = object> extends UserConfig
|
|
|
11
11
|
}
|
|
12
12
|
declare function WebpackPlugin<Theme extends object>(configOrPath?: WebpackPluginOptions<Theme> | string, defaults?: UserConfigDefaults): webpack.WebpackPluginInstance;
|
|
13
13
|
|
|
14
|
-
export {
|
|
14
|
+
export { WebpackPlugin as default };
|
|
15
|
+
export type { WebpackPluginOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,5 @@ interface WebpackPluginOptions<Theme extends object = object> extends UserConfig
|
|
|
11
11
|
}
|
|
12
12
|
declare function WebpackPlugin<Theme extends object>(configOrPath?: WebpackPluginOptions<Theme> | string, defaults?: UserConfigDefaults): webpack.WebpackPluginInstance;
|
|
13
13
|
|
|
14
|
-
// @ts-ignore
|
|
15
14
|
export = WebpackPlugin;
|
|
16
15
|
export type { WebpackPluginOptions };
|
package/dist/index.mjs
CHANGED
package/dist/rspack.cjs
CHANGED
package/dist/rspack.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolve, isAbsolute, normalize } from 'node:path';
|
|
2
|
-
import process
|
|
2
|
+
import process from 'node:process';
|
|
3
3
|
import fs from 'node:fs/promises';
|
|
4
4
|
import { glob } from 'tinyglobby';
|
|
5
5
|
import remapping from '@ampproject/remapping';
|
|
@@ -143,26 +143,11 @@ const defaultPipelineExclude = [cssIdRE];
|
|
|
143
143
|
const defaultPipelineInclude = [/\.(vue|svelte|[jt]sx|vine.ts|mdx?|astro|elm|php|phtml|html)($|\?)/];
|
|
144
144
|
|
|
145
145
|
function deprecationCheck(config) {
|
|
146
|
-
let warned = false;
|
|
147
|
-
function warn(msg) {
|
|
148
|
-
warned = true;
|
|
149
|
-
console.warn(`[unocss] ${msg}`);
|
|
150
|
-
}
|
|
151
|
-
if (config.include)
|
|
152
|
-
warn("`include` option is deprecated, use `content.pipeline.include` instead.");
|
|
153
|
-
if (config.exclude)
|
|
154
|
-
warn("`exclude` option is deprecated, use `content.pipeline.exclude` instead.");
|
|
155
|
-
if (config.extraContent)
|
|
156
|
-
warn("`extraContent` option is deprecated, use `content` instead.");
|
|
157
|
-
if (config.content?.plain)
|
|
158
|
-
warn("`content.plain` option is renamed to `content.inline`.");
|
|
159
|
-
if (warned && typeof process !== "undefined" && process.env.CI)
|
|
160
|
-
throw new Error("deprecation warning");
|
|
161
146
|
}
|
|
162
147
|
|
|
163
148
|
function createContext(configOrPath, defaults = {}, extraConfigSources = [], resolveConfigResult = () => {
|
|
164
149
|
}) {
|
|
165
|
-
let root = process
|
|
150
|
+
let root = process.cwd();
|
|
166
151
|
let rawConfig = {};
|
|
167
152
|
let configFileList = [];
|
|
168
153
|
let uno;
|
|
@@ -193,8 +178,8 @@ function createContext(configOrPath, defaults = {}, extraConfigSources = [], res
|
|
|
193
178
|
await uno.setConfig(rawConfig);
|
|
194
179
|
uno.config.envMode = "dev";
|
|
195
180
|
rollupFilter = rawConfig.content?.pipeline === false ? () => false : createFilter(
|
|
196
|
-
rawConfig.content?.pipeline?.include ||
|
|
197
|
-
rawConfig.content?.pipeline?.exclude ||
|
|
181
|
+
rawConfig.content?.pipeline?.include || defaultPipelineInclude,
|
|
182
|
+
rawConfig.content?.pipeline?.exclude || defaultPipelineExclude,
|
|
198
183
|
{ resolve: typeof configOrPath === "string" ? configOrPath : root }
|
|
199
184
|
);
|
|
200
185
|
tokens.clear();
|
|
@@ -322,7 +307,7 @@ const UPDATE_DEBOUNCE = 10;
|
|
|
322
307
|
function unplugin(configOrPath, defaults) {
|
|
323
308
|
return createUnplugin(() => {
|
|
324
309
|
const ctx = createContext(configOrPath, {
|
|
325
|
-
envMode: process
|
|
310
|
+
envMode: process.env.NODE_ENV === "development" ? "dev" : "build",
|
|
326
311
|
...defaults
|
|
327
312
|
});
|
|
328
313
|
const { tokens, filter, extract, onInvalidate, tasks, flushTasks } = ctx;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const node_path = require('node:path');
|
|
4
|
-
const process
|
|
4
|
+
const process = require('node:process');
|
|
5
5
|
const fs = require('node:fs/promises');
|
|
6
6
|
const tinyglobby = require('tinyglobby');
|
|
7
7
|
const remapping = require('@ampproject/remapping');
|
|
@@ -16,7 +16,7 @@ const WebpackSources = require('webpack-sources');
|
|
|
16
16
|
|
|
17
17
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
18
18
|
|
|
19
|
-
const process__default = /*#__PURE__*/_interopDefaultCompat(process
|
|
19
|
+
const process__default = /*#__PURE__*/_interopDefaultCompat(process);
|
|
20
20
|
const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
21
21
|
const remapping__default = /*#__PURE__*/_interopDefaultCompat(remapping);
|
|
22
22
|
const MagicString__default = /*#__PURE__*/_interopDefaultCompat(MagicString);
|
|
@@ -153,21 +153,6 @@ const defaultPipelineExclude = [core.cssIdRE];
|
|
|
153
153
|
const defaultPipelineInclude = [/\.(vue|svelte|[jt]sx|vine.ts|mdx?|astro|elm|php|phtml|html)($|\?)/];
|
|
154
154
|
|
|
155
155
|
function deprecationCheck(config) {
|
|
156
|
-
let warned = false;
|
|
157
|
-
function warn(msg) {
|
|
158
|
-
warned = true;
|
|
159
|
-
console.warn(`[unocss] ${msg}`);
|
|
160
|
-
}
|
|
161
|
-
if (config.include)
|
|
162
|
-
warn("`include` option is deprecated, use `content.pipeline.include` instead.");
|
|
163
|
-
if (config.exclude)
|
|
164
|
-
warn("`exclude` option is deprecated, use `content.pipeline.exclude` instead.");
|
|
165
|
-
if (config.extraContent)
|
|
166
|
-
warn("`extraContent` option is deprecated, use `content` instead.");
|
|
167
|
-
if (config.content?.plain)
|
|
168
|
-
warn("`content.plain` option is renamed to `content.inline`.");
|
|
169
|
-
if (warned && typeof process !== "undefined" && process.env.CI)
|
|
170
|
-
throw new Error("deprecation warning");
|
|
171
156
|
}
|
|
172
157
|
|
|
173
158
|
function createContext(configOrPath, defaults = {}, extraConfigSources = [], resolveConfigResult = () => {
|
|
@@ -203,8 +188,8 @@ function createContext(configOrPath, defaults = {}, extraConfigSources = [], res
|
|
|
203
188
|
await uno.setConfig(rawConfig);
|
|
204
189
|
uno.config.envMode = "dev";
|
|
205
190
|
rollupFilter = rawConfig.content?.pipeline === false ? () => false : unpluginUtils.createFilter(
|
|
206
|
-
rawConfig.content?.pipeline?.include ||
|
|
207
|
-
rawConfig.content?.pipeline?.exclude ||
|
|
191
|
+
rawConfig.content?.pipeline?.include || defaultPipelineInclude,
|
|
192
|
+
rawConfig.content?.pipeline?.exclude || defaultPipelineExclude,
|
|
208
193
|
{ resolve: typeof configOrPath === "string" ? configOrPath : root }
|
|
209
194
|
);
|
|
210
195
|
tokens.clear();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/webpack",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "66.
|
|
4
|
+
"version": "66.4.0",
|
|
5
5
|
"description": "The Webpack plugin for UnoCSS",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"homepage": "https://unocss.dev",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/unocss/unocss",
|
|
12
|
+
"url": "git+https://github.com/unocss/unocss.git",
|
|
13
13
|
"directory": "packages-integrations/webpack"
|
|
14
14
|
},
|
|
15
15
|
"bugs": {
|
|
@@ -68,13 +68,13 @@
|
|
|
68
68
|
"unplugin": "^2.3.5",
|
|
69
69
|
"unplugin-utils": "^0.2.4",
|
|
70
70
|
"webpack-sources": "^3.3.3",
|
|
71
|
-
"@unocss/config": "66.
|
|
72
|
-
"@unocss/core": "66.
|
|
71
|
+
"@unocss/config": "66.4.0",
|
|
72
|
+
"@unocss/core": "66.4.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/webpack": "^5.28.5",
|
|
76
76
|
"@types/webpack-sources": "^3.2.3",
|
|
77
|
-
"webpack": "^5.
|
|
77
|
+
"webpack": "^5.101.0"
|
|
78
78
|
},
|
|
79
79
|
"scripts": {
|
|
80
80
|
"build": "unbuild",
|