@unocss/webpack 65.4.0 → 65.4.2

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 CHANGED
@@ -1,10 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const unplugin = require('./shared/webpack.Cncj5QVL.cjs');
3
+ const unplugin = require('./shared/webpack.DMgBm-HL.cjs');
4
4
  require('node:path');
5
5
  require('node:process');
6
- require('unplugin');
7
- require('webpack-sources');
8
6
  require('node:fs/promises');
9
7
  require('tinyglobby');
10
8
  require('@ampproject/remapping');
@@ -13,6 +11,8 @@ require('@unocss/core');
13
11
  require('@rollup/pluginutils');
14
12
  require('@unocss/config');
15
13
  require('node:crypto');
14
+ require('unplugin');
15
+ require('webpack-sources');
16
16
 
17
17
  function WebpackPlugin(configOrPath, defaults) {
18
18
  return unplugin.unplugin(configOrPath, defaults).webpack();
package/dist/index.d.cts CHANGED
@@ -11,5 +11,4 @@ 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 = WebpackPlugin;
15
- export { type WebpackPluginOptions };
14
+ export { type WebpackPluginOptions, WebpackPlugin as default };
package/dist/index.d.ts CHANGED
@@ -11,5 +11,4 @@ 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 = WebpackPlugin;
15
- export { type WebpackPluginOptions };
14
+ export { type WebpackPluginOptions, WebpackPlugin as default };
package/dist/index.mjs CHANGED
@@ -1,8 +1,6 @@
1
- import { u as unplugin } from './shared/webpack.FgPx67GX.mjs';
1
+ import { u as unplugin } from './shared/webpack.B8kbUzqo.mjs';
2
2
  import 'node:path';
3
3
  import 'node:process';
4
- import 'unplugin';
5
- import 'webpack-sources';
6
4
  import 'node:fs/promises';
7
5
  import 'tinyglobby';
8
6
  import '@ampproject/remapping';
@@ -11,6 +9,8 @@ import '@unocss/core';
11
9
  import '@rollup/pluginutils';
12
10
  import '@unocss/config';
13
11
  import 'node:crypto';
12
+ import 'unplugin';
13
+ import 'webpack-sources';
14
14
 
15
15
  function WebpackPlugin(configOrPath, defaults) {
16
16
  return unplugin(configOrPath, defaults).webpack();
package/dist/rspack.cjs CHANGED
@@ -1,10 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const unplugin = require('./shared/webpack.Cncj5QVL.cjs');
3
+ const unplugin = require('./shared/webpack.DMgBm-HL.cjs');
4
4
  require('node:path');
5
5
  require('node:process');
6
- require('unplugin');
7
- require('webpack-sources');
8
6
  require('node:fs/promises');
9
7
  require('tinyglobby');
10
8
  require('@ampproject/remapping');
@@ -13,6 +11,8 @@ require('@unocss/core');
13
11
  require('@rollup/pluginutils');
14
12
  require('@unocss/config');
15
13
  require('node:crypto');
14
+ require('unplugin');
15
+ require('webpack-sources');
16
16
 
17
17
  function UnoCSSRspackPlugin(configOrPath, defaults) {
18
18
  return unplugin.unplugin(configOrPath, defaults).rspack();
package/dist/rspack.mjs CHANGED
@@ -1,8 +1,6 @@
1
- import { u as unplugin } from './shared/webpack.FgPx67GX.mjs';
1
+ import { u as unplugin } from './shared/webpack.B8kbUzqo.mjs';
2
2
  import 'node:path';
3
3
  import 'node:process';
4
- import 'unplugin';
5
- import 'webpack-sources';
6
4
  import 'node:fs/promises';
7
5
  import 'tinyglobby';
8
6
  import '@ampproject/remapping';
@@ -11,6 +9,8 @@ import '@unocss/core';
11
9
  import '@rollup/pluginutils';
12
10
  import '@unocss/config';
13
11
  import 'node:crypto';
12
+ import 'unplugin';
13
+ import 'webpack-sources';
14
14
 
15
15
  function UnoCSSRspackPlugin(configOrPath, defaults) {
16
16
  return unplugin(configOrPath, defaults).rspack();
@@ -1,7 +1,5 @@
1
1
  import { resolve, isAbsolute, normalize } from 'node:path';
2
2
  import process$1 from 'node:process';
3
- import { createUnplugin } from 'unplugin';
4
- import WebpackSources from 'webpack-sources';
5
3
  import fs from 'node:fs/promises';
6
4
  import { glob } from 'tinyglobby';
7
5
  import remapping from '@ampproject/remapping';
@@ -10,6 +8,8 @@ import { cssIdRE, createGenerator, BetterMap } from '@unocss/core';
10
8
  import { createFilter } from '@rollup/pluginutils';
11
9
  import { createRecoveryConfigLoader } from '@unocss/config';
12
10
  import { createHash } from 'node:crypto';
11
+ import { createUnplugin } from 'unplugin';
12
+ import WebpackSources from 'webpack-sources';
13
13
 
14
14
  const INCLUDE_COMMENT = "@unocss-include";
15
15
  const IGNORE_COMMENT = "@unocss-ignore";
@@ -382,11 +382,7 @@ function unplugin(configOrPath, defaults) {
382
382
  }
383
383
  });
384
384
  compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
385
- const optimizeAssetsHook = (
386
- /* webpack 5 & 6 */
387
- compilation.hooks.processAssets || /* webpack 4 */
388
- compilation.hooks.optimizeAssets
389
- );
385
+ const optimizeAssetsHook = compilation.hooks.processAssets || compilation.hooks.optimizeAssets;
390
386
  optimizeAssetsHook.tapPromise(PLUGIN_NAME, async () => {
391
387
  await ctx.ready;
392
388
  const files = Object.keys(compilation.assets);
@@ -401,7 +397,7 @@ function unplugin(configOrPath, defaults) {
401
397
  code = code.replace(HASH_PLACEHOLDER_RE, "");
402
398
  code = code.replace(LAYER_PLACEHOLDER_RE, (_, layer, escapeView) => {
403
399
  replaced = true;
404
- const css = layer.trim() === LAYER_MARK_ALL ? result.getLayers(void 0, Array.from(entries).map((i) => resolveLayer(i)).filter((i) => !!i)) : result.getLayer(layer) || "";
400
+ const css = layer.trim() === LAYER_MARK_ALL ? result.getLayers(undefined, Array.from(entries).map((i) => resolveLayer(i)).filter((i) => !!i)) : result.getLayer(layer) || "";
405
401
  escapeCss = escapeCss ?? getCssEscaperForJsContent(escapeView.trim());
406
402
  return escapeCss(css);
407
403
  });
@@ -430,7 +426,7 @@ function unplugin(configOrPath, defaults) {
430
426
  const layer = resolveLayer(path);
431
427
  if (!layer)
432
428
  return;
433
- const code = layer === LAYER_MARK_ALL ? result.getLayers(void 0, Array.from(entries).map((i) => resolveLayer(i)).filter((i) => !!i)) : result.getLayer(layer) || "";
429
+ const code = layer === LAYER_MARK_ALL ? result.getLayers(undefined, Array.from(entries).map((i) => resolveLayer(i)).filter((i) => !!i)) : result.getLayer(layer) || "";
434
430
  const hash = getHash(code);
435
431
  hashes.set(path, hash);
436
432
  plugin.__vfs.writeModule(id, code);
@@ -2,8 +2,6 @@
2
2
 
3
3
  const node_path = require('node:path');
4
4
  const process$1 = require('node:process');
5
- const unplugin$1 = require('unplugin');
6
- const WebpackSources = require('webpack-sources');
7
5
  const fs = require('node:fs/promises');
8
6
  const tinyglobby = require('tinyglobby');
9
7
  const remapping = require('@ampproject/remapping');
@@ -12,14 +10,16 @@ const core = require('@unocss/core');
12
10
  const pluginutils = require('@rollup/pluginutils');
13
11
  const config = require('@unocss/config');
14
12
  const node_crypto = require('node:crypto');
13
+ const unplugin$1 = require('unplugin');
14
+ const WebpackSources = require('webpack-sources');
15
15
 
16
16
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
17
17
 
18
18
  const process__default = /*#__PURE__*/_interopDefaultCompat(process$1);
19
- const WebpackSources__default = /*#__PURE__*/_interopDefaultCompat(WebpackSources);
20
19
  const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
21
20
  const remapping__default = /*#__PURE__*/_interopDefaultCompat(remapping);
22
21
  const MagicString__default = /*#__PURE__*/_interopDefaultCompat(MagicString);
22
+ const WebpackSources__default = /*#__PURE__*/_interopDefaultCompat(WebpackSources);
23
23
 
24
24
  const INCLUDE_COMMENT = "@unocss-include";
25
25
  const IGNORE_COMMENT = "@unocss-ignore";
@@ -392,11 +392,7 @@ function unplugin(configOrPath, defaults) {
392
392
  }
393
393
  });
394
394
  compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
395
- const optimizeAssetsHook = (
396
- /* webpack 5 & 6 */
397
- compilation.hooks.processAssets || /* webpack 4 */
398
- compilation.hooks.optimizeAssets
399
- );
395
+ const optimizeAssetsHook = compilation.hooks.processAssets || compilation.hooks.optimizeAssets;
400
396
  optimizeAssetsHook.tapPromise(PLUGIN_NAME, async () => {
401
397
  await ctx.ready;
402
398
  const files = Object.keys(compilation.assets);
@@ -411,7 +407,7 @@ function unplugin(configOrPath, defaults) {
411
407
  code = code.replace(HASH_PLACEHOLDER_RE, "");
412
408
  code = code.replace(LAYER_PLACEHOLDER_RE, (_, layer, escapeView) => {
413
409
  replaced = true;
414
- const css = layer.trim() === LAYER_MARK_ALL ? result.getLayers(void 0, Array.from(entries).map((i) => resolveLayer(i)).filter((i) => !!i)) : result.getLayer(layer) || "";
410
+ const css = layer.trim() === LAYER_MARK_ALL ? result.getLayers(undefined, Array.from(entries).map((i) => resolveLayer(i)).filter((i) => !!i)) : result.getLayer(layer) || "";
415
411
  escapeCss = escapeCss ?? getCssEscaperForJsContent(escapeView.trim());
416
412
  return escapeCss(css);
417
413
  });
@@ -440,7 +436,7 @@ function unplugin(configOrPath, defaults) {
440
436
  const layer = resolveLayer(path);
441
437
  if (!layer)
442
438
  return;
443
- const code = layer === LAYER_MARK_ALL ? result.getLayers(void 0, Array.from(entries).map((i) => resolveLayer(i)).filter((i) => !!i)) : result.getLayer(layer) || "";
439
+ const code = layer === LAYER_MARK_ALL ? result.getLayers(undefined, Array.from(entries).map((i) => resolveLayer(i)).filter((i) => !!i)) : result.getLayer(layer) || "";
444
440
  const hash = getHash(code);
445
441
  hashes.set(path, hash);
446
442
  plugin.__vfs.writeModule(id, code);
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@unocss/webpack",
3
3
  "type": "module",
4
- "version": "65.4.0",
4
+ "version": "65.4.2",
5
5
  "description": "The Webpack plugin for UnoCSS",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
8
8
  "funding": "https://github.com/sponsors/antfu",
9
- "homepage": "https://github.com/unocss/unocss/tree/main/packages/webpack#readme",
9
+ "homepage": "https://unocss.dev",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "https://github.com/unocss/unocss",
13
- "directory": "packages/webpack"
13
+ "directory": "packages-integrations/webpack"
14
14
  },
15
15
  "bugs": {
16
16
  "url": "https://github.com/unocss/unocss/issues"
@@ -65,10 +65,10 @@
65
65
  "chokidar": "^3.6.0",
66
66
  "magic-string": "^0.30.17",
67
67
  "tinyglobby": "^0.2.10",
68
- "unplugin": "^2.1.0",
68
+ "unplugin": "^2.1.2",
69
69
  "webpack-sources": "^3.2.3",
70
- "@unocss/config": "65.4.0",
71
- "@unocss/core": "65.4.0"
70
+ "@unocss/core": "65.4.2",
71
+ "@unocss/config": "65.4.2"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@types/webpack": "^5.28.5",