@unocss/webpack 66.4.1 → 66.5.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 CHANGED
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- const unplugin = require('./shared/webpack.NQTpiUaU.cjs');
3
+ const unplugin = require('./shared/webpack.CP-vXpa8.cjs');
4
4
  require('node:path');
5
5
  require('node:process');
6
6
  require('node:fs/promises');
7
7
  require('tinyglobby');
8
- require('@ampproject/remapping');
8
+ require('@jridgewell/remapping');
9
9
  require('magic-string');
10
10
  require('@unocss/core');
11
11
  require('@unocss/config');
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { u as unplugin } from './shared/webpack.AwO5g8V4.mjs';
1
+ import { u as unplugin } from './shared/webpack.Dedq-qCJ.mjs';
2
2
  import 'node:path';
3
3
  import 'node:process';
4
4
  import 'node:fs/promises';
5
5
  import 'tinyglobby';
6
- import '@ampproject/remapping';
6
+ import '@jridgewell/remapping';
7
7
  import 'magic-string';
8
8
  import '@unocss/core';
9
9
  import '@unocss/config';
package/dist/rspack.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- const unplugin = require('./shared/webpack.NQTpiUaU.cjs');
3
+ const unplugin = require('./shared/webpack.CP-vXpa8.cjs');
4
4
  require('node:path');
5
5
  require('node:process');
6
6
  require('node:fs/promises');
7
7
  require('tinyglobby');
8
- require('@ampproject/remapping');
8
+ require('@jridgewell/remapping');
9
9
  require('magic-string');
10
10
  require('@unocss/core');
11
11
  require('@unocss/config');
package/dist/rspack.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { u as unplugin } from './shared/webpack.AwO5g8V4.mjs';
1
+ import { u as unplugin } from './shared/webpack.Dedq-qCJ.mjs';
2
2
  import 'node:path';
3
3
  import 'node:process';
4
4
  import 'node:fs/promises';
5
5
  import 'tinyglobby';
6
- import '@ampproject/remapping';
6
+ import '@jridgewell/remapping';
7
7
  import 'magic-string';
8
8
  import '@unocss/core';
9
9
  import '@unocss/config';
@@ -4,12 +4,12 @@ const node_path = require('node:path');
4
4
  const process = require('node:process');
5
5
  const fs = require('node:fs/promises');
6
6
  const tinyglobby = require('tinyglobby');
7
- const remapping = require('@ampproject/remapping');
7
+ const remapping = require('@jridgewell/remapping');
8
8
  const MagicString = require('magic-string');
9
9
  const core = require('@unocss/core');
10
10
  const config = require('@unocss/config');
11
11
  const unpluginUtils = require('unplugin-utils');
12
- const node_crypto = require('node:crypto');
12
+ const crypto = require('node:crypto');
13
13
  require('pathe');
14
14
  const unplugin$1 = require('unplugin');
15
15
  const WebpackSources = require('webpack-sources');
@@ -20,6 +20,7 @@ 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);
23
+ const crypto__default = /*#__PURE__*/_interopDefaultCompat(crypto);
23
24
  const WebpackSources__default = /*#__PURE__*/_interopDefaultCompat(WebpackSources);
24
25
 
25
26
  const INCLUDE_COMMENT = "@unocss-include";
@@ -41,7 +42,7 @@ function getPath(id) {
41
42
  function isCssId(id) {
42
43
  return core.cssIdRE.test(id);
43
44
  }
44
- function hash(str) {
45
+ function hash$1(str) {
45
46
  let i;
46
47
  let l;
47
48
  let hval = 2166136261;
@@ -55,7 +56,7 @@ function transformSkipCode(code, map, SKIP_RULES_RE, keyFlag) {
55
56
  for (const item of Array.from(code.matchAll(SKIP_RULES_RE))) {
56
57
  if (item != null) {
57
58
  const matched = item[0];
58
- const withHashKey = `${keyFlag}${hash(matched)}`;
59
+ const withHashKey = `${keyFlag}${hash$1(matched)}`;
59
60
  map.set(withHashKey, matched);
60
61
  code = code.replace(matched, withHashKey);
61
62
  }
@@ -268,8 +269,9 @@ function createContext(configOrPath, defaults = {}, extraConfigSources = [], res
268
269
  };
269
270
  }
270
271
 
272
+ const hash = crypto__default.hash ?? ((algorithm, data, outputEncoding) => crypto__default.createHash(algorithm).update(data).digest(outputEncoding));
271
273
  function getHash(input, length = 8) {
272
- return node_crypto.createHash("sha256").update(input).digest("hex").slice(0, length);
274
+ return hash("sha256", input, "hex").substring(0, length);
273
275
  }
274
276
 
275
277
  function resolveId(id, importer) {
@@ -2,12 +2,12 @@ import { resolve, isAbsolute, normalize } from 'node:path';
2
2
  import process from 'node:process';
3
3
  import fs from 'node:fs/promises';
4
4
  import { glob } from 'tinyglobby';
5
- import remapping from '@ampproject/remapping';
5
+ import remapping from '@jridgewell/remapping';
6
6
  import MagicString from 'magic-string';
7
7
  import { cssIdRE, createGenerator, BetterMap } from '@unocss/core';
8
8
  import { createRecoveryConfigLoader } from '@unocss/config';
9
9
  import { createFilter } from 'unplugin-utils';
10
- import { createHash } from 'node:crypto';
10
+ import crypto from 'node:crypto';
11
11
  import 'pathe';
12
12
  import { createUnplugin } from 'unplugin';
13
13
  import WebpackSources from 'webpack-sources';
@@ -31,7 +31,7 @@ function getPath(id) {
31
31
  function isCssId(id) {
32
32
  return cssIdRE.test(id);
33
33
  }
34
- function hash(str) {
34
+ function hash$1(str) {
35
35
  let i;
36
36
  let l;
37
37
  let hval = 2166136261;
@@ -45,7 +45,7 @@ function transformSkipCode(code, map, SKIP_RULES_RE, keyFlag) {
45
45
  for (const item of Array.from(code.matchAll(SKIP_RULES_RE))) {
46
46
  if (item != null) {
47
47
  const matched = item[0];
48
- const withHashKey = `${keyFlag}${hash(matched)}`;
48
+ const withHashKey = `${keyFlag}${hash$1(matched)}`;
49
49
  map.set(withHashKey, matched);
50
50
  code = code.replace(matched, withHashKey);
51
51
  }
@@ -258,8 +258,9 @@ function createContext(configOrPath, defaults = {}, extraConfigSources = [], res
258
258
  };
259
259
  }
260
260
 
261
+ const hash = crypto.hash ?? ((algorithm, data, outputEncoding) => crypto.createHash(algorithm).update(data).digest(outputEncoding));
261
262
  function getHash(input, length = 8) {
262
- return createHash("sha256").update(input).digest("hex").slice(0, length);
263
+ return hash("sha256", input, "hex").substring(0, length);
263
264
  }
264
265
 
265
266
  function resolveId(id, importer) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unocss/webpack",
3
3
  "type": "module",
4
- "version": "66.4.1",
4
+ "version": "66.5.0",
5
5
  "description": "The Webpack plugin for UnoCSS",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -60,21 +60,21 @@
60
60
  "webpack": "^4 || ^5"
61
61
  },
62
62
  "dependencies": {
63
- "@ampproject/remapping": "^2.3.0",
63
+ "@jridgewell/remapping": "^2.3.5",
64
64
  "chokidar": "^3.6.0",
65
- "magic-string": "^0.30.17",
65
+ "magic-string": "^0.30.18",
66
66
  "pathe": "^2.0.3",
67
67
  "tinyglobby": "^0.2.14",
68
- "unplugin": "^2.3.5",
69
- "unplugin-utils": "^0.2.4",
68
+ "unplugin": "^2.3.9",
69
+ "unplugin-utils": "^0.3.0",
70
70
  "webpack-sources": "^3.3.3",
71
- "@unocss/config": "66.4.1",
72
- "@unocss/core": "66.4.1"
71
+ "@unocss/core": "66.5.0",
72
+ "@unocss/config": "66.5.0"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@types/webpack": "^5.28.5",
76
76
  "@types/webpack-sources": "^3.2.3",
77
- "webpack": "^5.101.0"
77
+ "webpack": "^5.101.3"
78
78
  },
79
79
  "scripts": {
80
80
  "build": "unbuild",