@unocss/vite 0.55.2 → 0.55.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/client.d.cts CHANGED
@@ -1,2 +1,2 @@
1
1
 
2
- export { }
2
+ export { }
package/dist/client.d.mts CHANGED
@@ -1,2 +1,2 @@
1
1
 
2
- export { }
2
+ export { }
package/dist/client.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
 
2
- export { }
2
+ export { }
package/dist/index.cjs CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ const process$1 = require('node:process');
5
6
  const UnocssInspector = require('@unocss/inspector');
6
7
  const node_path = require('node:path');
7
8
  const fs = require('node:fs/promises');
@@ -10,7 +11,6 @@ const MagicString = require('magic-string');
10
11
  const remapping = require('@ampproject/remapping');
11
12
  const node_crypto = require('node:crypto');
12
13
  const core = require('@unocss/core');
13
- const process$1 = require('node:process');
14
14
  const node_buffer = require('node:buffer');
15
15
  const pluginutils = require('@rollup/pluginutils');
16
16
  const fs$1 = require('node:fs');
@@ -19,12 +19,12 @@ const config = require('@unocss/config');
19
19
 
20
20
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
21
21
 
22
+ const process__default = /*#__PURE__*/_interopDefaultCompat(process$1);
22
23
  const UnocssInspector__default = /*#__PURE__*/_interopDefaultCompat(UnocssInspector);
23
24
  const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
24
25
  const fg__default = /*#__PURE__*/_interopDefaultCompat(fg);
25
26
  const MagicString__default = /*#__PURE__*/_interopDefaultCompat(MagicString);
26
27
  const remapping__default = /*#__PURE__*/_interopDefaultCompat(remapping);
27
- const process__default = /*#__PURE__*/_interopDefaultCompat(process$1);
28
28
  const fs__default$1 = /*#__PURE__*/_interopDefaultCompat(fs$1);
29
29
 
30
30
  const defaultPipelineExclude = [core.cssIdRE];
@@ -1200,7 +1200,10 @@ function defineConfig(config) {
1200
1200
  return config;
1201
1201
  }
1202
1202
  function UnocssPlugin(configOrPath, defaults = {}) {
1203
- const ctx = createContext(configOrPath, defaults);
1203
+ const ctx = createContext(configOrPath, {
1204
+ envMode: process__default.env.NODE_ENV === "development" ? "dev" : "build",
1205
+ ...defaults
1206
+ });
1204
1207
  const inlineConfig = configOrPath && typeof configOrPath !== "string" ? configOrPath : {};
1205
1208
  const mode = inlineConfig.mode ?? "global";
1206
1209
  const plugins = [
package/dist/index.d.cts CHANGED
@@ -66,4 +66,4 @@ interface UnocssVitePluginAPI {
66
66
  }
67
67
  declare function UnocssPlugin<Theme extends object>(configOrPath?: VitePluginConfig<Theme> | string, defaults?: UserConfigDefaults): Plugin[];
68
68
 
69
- export { ChunkModeBuildPlugin, GlobalModeBuildPlugin, GlobalModeDevPlugin, GlobalModePlugin, PerModuleModePlugin, UnocssVitePluginAPI, VitePluginConfig, VueScopedPlugin, UnocssPlugin as default, defineConfig };
69
+ export { ChunkModeBuildPlugin, GlobalModeBuildPlugin, GlobalModeDevPlugin, GlobalModePlugin, PerModuleModePlugin, type UnocssVitePluginAPI, type VitePluginConfig, VueScopedPlugin, UnocssPlugin as default, defineConfig };
package/dist/index.d.mts CHANGED
@@ -66,4 +66,4 @@ interface UnocssVitePluginAPI {
66
66
  }
67
67
  declare function UnocssPlugin<Theme extends object>(configOrPath?: VitePluginConfig<Theme> | string, defaults?: UserConfigDefaults): Plugin[];
68
68
 
69
- export { ChunkModeBuildPlugin, GlobalModeBuildPlugin, GlobalModeDevPlugin, GlobalModePlugin, PerModuleModePlugin, UnocssVitePluginAPI, VitePluginConfig, VueScopedPlugin, UnocssPlugin as default, defineConfig };
69
+ export { ChunkModeBuildPlugin, GlobalModeBuildPlugin, GlobalModeDevPlugin, GlobalModePlugin, PerModuleModePlugin, type UnocssVitePluginAPI, type VitePluginConfig, VueScopedPlugin, UnocssPlugin as default, defineConfig };
package/dist/index.d.ts CHANGED
@@ -66,4 +66,4 @@ interface UnocssVitePluginAPI {
66
66
  }
67
67
  declare function UnocssPlugin<Theme extends object>(configOrPath?: VitePluginConfig<Theme> | string, defaults?: UserConfigDefaults): Plugin[];
68
68
 
69
- export { ChunkModeBuildPlugin, GlobalModeBuildPlugin, GlobalModeDevPlugin, GlobalModePlugin, PerModuleModePlugin, UnocssVitePluginAPI, VitePluginConfig, VueScopedPlugin, UnocssPlugin as default, defineConfig };
69
+ export { ChunkModeBuildPlugin, GlobalModeBuildPlugin, GlobalModeDevPlugin, GlobalModePlugin, PerModuleModePlugin, type UnocssVitePluginAPI, type VitePluginConfig, VueScopedPlugin, UnocssPlugin as default, defineConfig };
package/dist/index.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ import process$1 from 'node:process';
1
2
  import UnocssInspector from '@unocss/inspector';
2
3
  import { resolve, isAbsolute, dirname } from 'node:path';
3
4
  import fs from 'node:fs/promises';
@@ -6,7 +7,6 @@ import MagicString from 'magic-string';
6
7
  import remapping from '@ampproject/remapping';
7
8
  import { createHash } from 'node:crypto';
8
9
  import { cssIdRE, createGenerator, BetterMap, notNull, toEscapedSelector } from '@unocss/core';
9
- import process$1 from 'node:process';
10
10
  import { Buffer } from 'node:buffer';
11
11
  import { createFilter } from '@rollup/pluginutils';
12
12
  import fs$1 from 'node:fs';
@@ -1186,7 +1186,10 @@ function defineConfig(config) {
1186
1186
  return config;
1187
1187
  }
1188
1188
  function UnocssPlugin(configOrPath, defaults = {}) {
1189
- const ctx = createContext(configOrPath, defaults);
1189
+ const ctx = createContext(configOrPath, {
1190
+ envMode: process$1.env.NODE_ENV === "development" ? "dev" : "build",
1191
+ ...defaults
1192
+ });
1190
1193
  const inlineConfig = configOrPath && typeof configOrPath !== "string" ? configOrPath : {};
1191
1194
  const mode = inlineConfig.mode ?? "global";
1192
1195
  const plugins = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/vite",
3
- "version": "0.55.2",
3
+ "version": "0.55.4",
4
4
  "description": "The Vite plugin for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -46,16 +46,16 @@
46
46
  "@rollup/pluginutils": "^5.0.3",
47
47
  "chokidar": "^3.5.3",
48
48
  "fast-glob": "^3.3.1",
49
- "magic-string": "^0.30.2",
50
- "@unocss/config": "0.55.2",
51
- "@unocss/core": "0.55.2",
52
- "@unocss/inspector": "0.55.2",
53
- "@unocss/scope": "0.55.2",
54
- "@unocss/transformer-directives": "0.55.2"
49
+ "magic-string": "^0.30.3",
50
+ "@unocss/config": "0.55.4",
51
+ "@unocss/core": "0.55.4",
52
+ "@unocss/inspector": "0.55.4",
53
+ "@unocss/scope": "0.55.4",
54
+ "@unocss/transformer-directives": "0.55.4"
55
55
  },
56
56
  "devDependencies": {
57
57
  "vite": "^4.4.9",
58
- "@unocss/shared-integration": "0.55.2"
58
+ "@unocss/shared-integration": "0.55.4"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "unbuild",