@unocss/webpack 0.50.3 → 0.50.4

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
@@ -7,12 +7,12 @@ const WebpackSources = require('webpack-sources');
7
7
  const pluginutils = require('@rollup/pluginutils');
8
8
  const config = require('@unocss/config');
9
9
  const core = require('@unocss/core');
10
- const fs = require('fs/promises');
11
- const path = require('path');
10
+ const fs = require('node:fs/promises');
11
+ const node_path = require('node:path');
12
12
  const fg = require('fast-glob');
13
13
  const MagicString = require('magic-string');
14
14
  const remapping = require('@ampproject/remapping');
15
- const crypto = require('crypto');
15
+ const node_crypto = require('node:crypto');
16
16
 
17
17
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
18
18
 
@@ -195,7 +195,7 @@ async function setupExtraContent(ctx, shouldWatch = false) {
195
195
  });
196
196
  watcher.on("all", (type, file) => {
197
197
  if (type === "add" || type === "change") {
198
- const absolutePath = path.resolve(root, file);
198
+ const absolutePath = node_path.resolve(root, file);
199
199
  tasks.push(extractFile(absolutePath));
200
200
  }
201
201
  });
@@ -205,7 +205,7 @@ async function setupExtraContent(ctx, shouldWatch = false) {
205
205
  }
206
206
 
207
207
  function getHash(input, length = 8) {
208
- return crypto.createHash("sha256").update(input).digest("hex").slice(0, length);
208
+ return node_crypto.createHash("sha256").update(input).digest("hex").slice(0, length);
209
209
  }
210
210
 
211
211
  const VIRTUAL_ENTRY_ALIAS = [
@@ -346,7 +346,7 @@ function WebpackPlugin(configOrPath, defaults) {
346
346
  return;
347
347
  lastTokenSize = tokens.size;
348
348
  Array.from(plugin.__vfsModules).forEach((id) => {
349
- const path = id.slice(plugin.__virtualModulePrefix.length).replace(/\\/g, "/");
349
+ const path = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length));
350
350
  const layer = resolveLayer(path);
351
351
  if (!layer)
352
352
  return;
package/dist/index.mjs CHANGED
@@ -3,12 +3,12 @@ import WebpackSources from 'webpack-sources';
3
3
  import { createFilter } from '@rollup/pluginutils';
4
4
  import { loadConfig } from '@unocss/config';
5
5
  import { cssIdRE, createGenerator, BetterMap } from '@unocss/core';
6
- import fs from 'fs/promises';
7
- import { resolve } from 'path';
6
+ import fs from 'node:fs/promises';
7
+ import { resolve } from 'node:path';
8
8
  import fg from 'fast-glob';
9
9
  import MagicString from 'magic-string';
10
10
  import remapping from '@ampproject/remapping';
11
- import { createHash } from 'crypto';
11
+ import { createHash } from 'node:crypto';
12
12
 
13
13
  const INCLUDE_COMMENT = "@unocss-include";
14
14
  const IGNORE_COMMENT = "@unocss-ignore";
@@ -334,7 +334,7 @@ function WebpackPlugin(configOrPath, defaults) {
334
334
  return;
335
335
  lastTokenSize = tokens.size;
336
336
  Array.from(plugin.__vfsModules).forEach((id) => {
337
- const path = id.slice(plugin.__virtualModulePrefix.length).replace(/\\/g, "/");
337
+ const path = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length));
338
338
  const layer = resolveLayer(path);
339
339
  if (!layer)
340
340
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/webpack",
3
- "version": "0.50.3",
3
+ "version": "0.50.4",
4
4
  "description": "The Webpack plugin for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -38,13 +38,13 @@
38
38
  "dependencies": {
39
39
  "@ampproject/remapping": "^2.2.0",
40
40
  "@rollup/pluginutils": "^5.0.2",
41
- "@unocss/config": "0.50.3",
42
- "@unocss/core": "0.50.3",
43
41
  "chokidar": "^3.5.3",
44
42
  "fast-glob": "^3.2.12",
45
43
  "magic-string": "^0.30.0",
46
44
  "unplugin": "^1.1.0",
47
- "webpack-sources": "^3.2.3"
45
+ "webpack-sources": "^3.2.3",
46
+ "@unocss/config": "0.50.4",
47
+ "@unocss/core": "0.50.4"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/webpack": "^5.28.0",