@unocss/vite 0.47.3 → 0.47.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
@@ -21,7 +21,7 @@ const remapping__default = /*#__PURE__*/_interopDefaultLegacy(remapping);
21
21
  const fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
22
22
 
23
23
  const defaultExclude = [core.cssIdRE];
24
- const defaultInclude = [/\.(vue|svelte|[jt]sx|mdx?|astro|elm|html)($|\?)/];
24
+ const defaultInclude = [/\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/];
25
25
 
26
26
  const VIRTUAL_ENTRY_ALIAS = [
27
27
  /^(?:virtual:)?uno(?::(.+))?\.css(\?.*)?$/
@@ -338,6 +338,8 @@ function GlobalModeBuildPlugin({ uno, ready, extract, tokens, filter, getConfig
338
338
  name: "unocss:global:build:generate",
339
339
  apply: "build",
340
340
  async renderChunk(code, chunk, options) {
341
+ if (!Object.keys(chunk.modules).some((i) => i.match(RESOLVED_ID_RE)))
342
+ return null;
341
343
  const cssPost = cssPostPlugins.get(options.dir);
342
344
  if (!cssPost) {
343
345
  this.warn("[unocss] failed to find vite:css-post plugin. It might be an internal bug of UnoCSS");
package/dist/index.mjs CHANGED
@@ -10,7 +10,7 @@ import fs from 'fs';
10
10
  import { fileURLToPath } from 'url';
11
11
 
12
12
  const defaultExclude = [cssIdRE];
13
- const defaultInclude = [/\.(vue|svelte|[jt]sx|mdx?|astro|elm|html)($|\?)/];
13
+ const defaultInclude = [/\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/];
14
14
 
15
15
  const VIRTUAL_ENTRY_ALIAS = [
16
16
  /^(?:virtual:)?uno(?::(.+))?\.css(\?.*)?$/
@@ -327,6 +327,8 @@ function GlobalModeBuildPlugin({ uno, ready, extract, tokens, filter, getConfig
327
327
  name: "unocss:global:build:generate",
328
328
  apply: "build",
329
329
  async renderChunk(code, chunk, options) {
330
+ if (!Object.keys(chunk.modules).some((i) => i.match(RESOLVED_ID_RE)))
331
+ return null;
330
332
  const cssPost = cssPostPlugins.get(options.dir);
331
333
  if (!cssPost) {
332
334
  this.warn("[unocss] failed to find vite:css-post plugin. It might be an internal bug of UnoCSS");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/vite",
3
- "version": "0.47.3",
3
+ "version": "0.47.5",
4
4
  "description": "The Vite plugin for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -44,15 +44,15 @@
44
44
  "dependencies": {
45
45
  "@ampproject/remapping": "^2.2.0",
46
46
  "@rollup/pluginutils": "^5.0.2",
47
- "@unocss/config": "0.47.3",
48
- "@unocss/core": "0.47.3",
49
- "@unocss/inspector": "0.47.3",
50
- "@unocss/scope": "0.47.3",
51
- "@unocss/transformer-directives": "0.47.3",
47
+ "@unocss/config": "0.47.5",
48
+ "@unocss/core": "0.47.5",
49
+ "@unocss/inspector": "0.47.5",
50
+ "@unocss/scope": "0.47.5",
51
+ "@unocss/transformer-directives": "0.47.5",
52
52
  "magic-string": "^0.26.7"
53
53
  },
54
54
  "devDependencies": {
55
- "@unocss/shared-integration": "0.47.3",
55
+ "@unocss/shared-integration": "0.47.5",
56
56
  "vite": "^3.2.4"
57
57
  },
58
58
  "scripts": {