@unocss/webpack 0.58.3 → 0.58.5

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
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const process$1 = require('node:process');
6
+ const node_path = require('node:path');
6
7
  const unplugin = require('unplugin');
7
8
  const WebpackSources = require('webpack-sources');
8
9
  const pluginutils = require('@rollup/pluginutils');
9
10
  const config = require('@unocss/config');
10
11
  const core = require('@unocss/core');
11
12
  const fs = require('node:fs/promises');
12
- const node_path = require('node:path');
13
13
  const fg = require('fast-glob');
14
14
  const MagicString = require('magic-string');
15
15
  const remapping = require('@ampproject/remapping');
@@ -414,7 +414,8 @@ function WebpackPlugin(configOrPath, defaults) {
414
414
  return;
415
415
  lastTokenSize = tokens.size;
416
416
  Array.from(plugin.__vfsModules).forEach((id) => {
417
- const path = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length));
417
+ let path = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length));
418
+ path = normalizeAbsolutePath(path);
418
419
  const layer = resolveLayer(path);
419
420
  if (!layer)
420
421
  return;
@@ -436,6 +437,12 @@ function getLayer(id) {
436
437
  }
437
438
  return layer;
438
439
  }
440
+ function normalizeAbsolutePath(path) {
441
+ if (node_path.isAbsolute(path))
442
+ return node_path.normalize(path);
443
+ else
444
+ return path;
445
+ }
439
446
 
440
447
  exports.default = WebpackPlugin;
441
448
  exports.defineConfig = defineConfig;
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  import process$1 from 'node:process';
2
+ import { resolve, isAbsolute, normalize } from 'node:path';
2
3
  import { createUnplugin } from 'unplugin';
3
4
  import WebpackSources from 'webpack-sources';
4
5
  import { createFilter } from '@rollup/pluginutils';
5
6
  import { loadConfig } from '@unocss/config';
6
7
  import { cssIdRE, createGenerator, BetterMap } from '@unocss/core';
7
8
  import fs from 'node:fs/promises';
8
- import { resolve, isAbsolute } from 'node:path';
9
9
  import fg from 'fast-glob';
10
10
  import MagicString from 'magic-string';
11
11
  import remapping from '@ampproject/remapping';
@@ -401,7 +401,8 @@ function WebpackPlugin(configOrPath, defaults) {
401
401
  return;
402
402
  lastTokenSize = tokens.size;
403
403
  Array.from(plugin.__vfsModules).forEach((id) => {
404
- const path = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length));
404
+ let path = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length));
405
+ path = normalizeAbsolutePath(path);
405
406
  const layer = resolveLayer(path);
406
407
  if (!layer)
407
408
  return;
@@ -423,5 +424,11 @@ function getLayer(id) {
423
424
  }
424
425
  return layer;
425
426
  }
427
+ function normalizeAbsolutePath(path) {
428
+ if (isAbsolute(path))
429
+ return normalize(path);
430
+ else
431
+ return path;
432
+ }
426
433
 
427
434
  export { WebpackPlugin as default, defineConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/webpack",
3
- "version": "0.58.3",
3
+ "version": "0.58.5",
4
4
  "description": "The Webpack plugin for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -40,16 +40,16 @@
40
40
  "@rollup/pluginutils": "^5.1.0",
41
41
  "chokidar": "^3.5.3",
42
42
  "fast-glob": "^3.3.2",
43
- "magic-string": "^0.30.5",
43
+ "magic-string": "^0.30.6",
44
44
  "unplugin": "^1.6.0",
45
45
  "webpack-sources": "^3.2.3",
46
- "@unocss/config": "0.58.3",
47
- "@unocss/core": "0.58.3"
46
+ "@unocss/config": "0.58.5",
47
+ "@unocss/core": "0.58.5"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/webpack": "^5.28.5",
51
51
  "@types/webpack-sources": "^3.2.3",
52
- "webpack": "^5.89.0"
52
+ "webpack": "^5.90.1"
53
53
  },
54
54
  "scripts": {
55
55
  "build": "unbuild",