@vizejs/unplugin 0.661.0 → 0.662.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/README.md +1 -1
- package/dist/babel.cjs +1 -1
- package/dist/babel.mjs +1 -1
- package/dist/esbuild.cjs +1 -1
- package/dist/esbuild.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/rolldown.cjs +1 -1
- package/dist/rolldown.mjs +1 -1
- package/dist/rollup.cjs +1 -1
- package/dist/rollup.mjs +1 -1
- package/dist/{unplugin-Bs967qTR.mjs → unplugin-BbWP410q.mjs} +54 -72
- package/dist/{unplugin-CpAttP-g.cjs → unplugin-Dl8hs9VI.cjs} +54 -72
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -118,7 +118,7 @@ TypeScript/JSX transforms in the pipeline if your SFC scripts use those syntaxes
|
|
|
118
118
|
- Plain inline CSS is injected into JavaScript at runtime; CSS asset extraction and SSR stylesheet delivery are not provided by this path.
|
|
119
119
|
- `<style src>`, `<script src>` and `<template src>` follow Vue's SFC spec, as in `@vitejs/plugin-vue`: a `./` or `../` path is read next to the SFC, and any other `src` (a package such as `modern-normalize/modern-normalize.css`, an alias, an absolute path, or a bare `foo.css`) is a module request resolved by the bundler's own resolver. The file is inlined before compilation and watched. A request that resolves to no file, including an external module, is a build error.
|
|
120
120
|
- `@import` in plain CSS is a build error. Plain CSS is injected at runtime as a string, so an `@import` would be fetched relative to the page. Inline the imported CSS, move the block to a preprocessor or CSS Module (handled by the host CSS pipeline), or use `@vizejs/vite-plugin`.
|
|
121
|
-
- CSS Modules and preprocessors depend on the host bundler CSS pipeline and are more likely to change than the Vite path.
|
|
121
|
+
- CSS Modules and preprocessors depend on the host bundler CSS pipeline and are more likely to change than the Vite path. Each block is a module named like Vue's style requests, `App.vue?vue&type=style&index=0&lang.css` (`lang.module.css`, `lang.scss`), so a pipeline that handles a `.css` or `.scss` file (`@tsdown/css`, `rollup-plugin-postcss`, esbuild) handles the block, and a host without one reports the same error it reports for such a file.
|
|
122
122
|
- Scoped preprocessor styles are compiled before they are scoped, as in Vue: Webpack uses your `.scss`/`.less`/`.styl` rules, while Rollup, Rolldown and esbuild run the project's installed `sass` (or `sass-embedded`), `less` or `stylus`.
|
|
123
123
|
- If your bundler inlines the Vue runtime, Vize injects the usual Vue 3 compile-time feature flags for Rollup-like and Webpack hosts when its compiler is active.
|
|
124
124
|
- Test carefully before depending on this package in production.
|
package/dist/babel.cjs
CHANGED
package/dist/babel.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as createFilter, i as generateOutput, r as compileVueModule, t as normalizeOptions } from "./unplugin-
|
|
1
|
+
import { a as createFilter, i as generateOutput, r as compileVueModule, t as normalizeOptions } from "./unplugin-BbWP410q.mjs";
|
|
2
2
|
//#region src/babel.ts
|
|
3
3
|
function vizeBabelPlugin(_api, rawOptions = {}) {
|
|
4
4
|
const options = normalizeOptions(rawOptions);
|
package/dist/esbuild.cjs
CHANGED
package/dist/esbuild.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -2,6 +2,6 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_unplugin = require("./unplugin-
|
|
5
|
+
const require_unplugin = require("./unplugin-Dl8hs9VI.cjs");
|
|
6
6
|
exports.default = require_unplugin.vizeUnplugin;
|
|
7
7
|
exports.vizeUnplugin = require_unplugin.vizeUnplugin;
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as vizeUnplugin } from "./unplugin-
|
|
1
|
+
import { n as vizeUnplugin } from "./unplugin-BbWP410q.mjs";
|
|
2
2
|
export { vizeUnplugin as default, vizeUnplugin };
|
package/dist/rolldown.cjs
CHANGED
package/dist/rolldown.mjs
CHANGED
package/dist/rollup.cjs
CHANGED
package/dist/rollup.mjs
CHANGED
|
@@ -93,6 +93,53 @@ function prependMappedJsxCode(code, mapJson, prefix) {
|
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
//#endregion
|
|
96
|
+
//#region src/request.ts
|
|
97
|
+
function isVueFile(id) {
|
|
98
|
+
return id.endsWith(".vue");
|
|
99
|
+
}
|
|
100
|
+
function isJsxFile(id) {
|
|
101
|
+
return id.endsWith(".jsx") || id.endsWith(".tsx");
|
|
102
|
+
}
|
|
103
|
+
function isVueStyleRequest(id) {
|
|
104
|
+
if (!id.includes("?vue")) return false;
|
|
105
|
+
const { query } = parseVueRequest(id);
|
|
106
|
+
return query.vue && query.type === "style";
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The module id of a delegated style block, in Vue's request shape:
|
|
110
|
+
* `App.vue?vue&type=style&index=0[&scoped=…][&module[=name]]&lang.<ext>`.
|
|
111
|
+
*
|
|
112
|
+
* CSS pipelines classify a module by the extension that ends the id, and treat
|
|
113
|
+
* a query on a stylesheet path as another import kind (`?raw`, `?inline`), so
|
|
114
|
+
* the path stays the SFC and `<ext>` names what `load` returns: a scoped
|
|
115
|
+
* preprocessor block is compiled before scoping, so it is CSS.
|
|
116
|
+
*/
|
|
117
|
+
function styleRequestId(filePath, block, scoped) {
|
|
118
|
+
const lang = block.lang ?? "css";
|
|
119
|
+
const delivered = scoped && isPreprocessorLang(lang) ? "css" : lang;
|
|
120
|
+
let query = `vue&type=style&index=${block.index}`;
|
|
121
|
+
if (scoped) query += `&scoped=${encodeURIComponent(scoped)}`;
|
|
122
|
+
if (block.module !== false) query += typeof block.module === "string" ? `&module=${encodeURIComponent(block.module)}` : "&module";
|
|
123
|
+
const ext = block.module === false ? delivered : `module.${delivered}`;
|
|
124
|
+
return `${filePath}?${query}&lang.${ext}`;
|
|
125
|
+
}
|
|
126
|
+
function parseVueRequest(id) {
|
|
127
|
+
const [filename, rawQuery = ""] = id.split("?", 2);
|
|
128
|
+
const params = new URLSearchParams(rawQuery);
|
|
129
|
+
const moduleValue = params.has("module") ? params.get("module") || true : false;
|
|
130
|
+
const indexValue = params.get("index");
|
|
131
|
+
return {
|
|
132
|
+
filename,
|
|
133
|
+
query: {
|
|
134
|
+
vue: params.has("vue"),
|
|
135
|
+
type: params.get("type"),
|
|
136
|
+
index: indexValue === null ? null : Number.parseInt(indexValue, 10),
|
|
137
|
+
module: moduleValue,
|
|
138
|
+
scoped: params.get("scoped")
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
//#endregion
|
|
96
143
|
//#region src/style.ts
|
|
97
144
|
function needsPreprocessor(block) {
|
|
98
145
|
return isPreprocessorLang(block.lang);
|
|
@@ -166,27 +213,16 @@ function generateOutput(compiled, options) {
|
|
|
166
213
|
const styleImports = [];
|
|
167
214
|
const cssModuleImports = [];
|
|
168
215
|
for (const block of compiled.styles) {
|
|
169
|
-
const lang = block.lang ?? "css";
|
|
170
|
-
const params = new URLSearchParams();
|
|
171
|
-
params.set("vue", "");
|
|
172
|
-
params.set("type", "style");
|
|
173
|
-
params.set("index", String(block.index));
|
|
174
|
-
params.set("lang", lang);
|
|
175
|
-
if (block.scoped) params.set("scoped", `data-v-${compiled.scopeId}`);
|
|
176
216
|
const scoped = block.scoped ? `data-v-${compiled.scopeId}` : null;
|
|
177
217
|
const styleFile = styleRequest?.(block, scoped);
|
|
218
|
+
const styleId = styleFile ?? styleRequestId(filePath, block, scoped);
|
|
178
219
|
if (isCssModule(block)) {
|
|
179
220
|
const bindingName = typeof block.module === "string" ? block.module : "$style";
|
|
180
221
|
if (styleFile) {
|
|
181
222
|
const namespace = `__vize_css_module_${block.index}__`;
|
|
182
223
|
cssModuleImports.push(`import * as ${namespace} from ${JSON.stringify(styleFile)};`, `const ${bindingName} = ${CSS_MODULE_LOCALS}(${namespace});`);
|
|
183
|
-
} else {
|
|
184
|
-
|
|
185
|
-
moduleParams.set("module", typeof block.module === "string" ? block.module : "");
|
|
186
|
-
const moduleUrl = `${filePath}?${moduleParams.toString()}`;
|
|
187
|
-
cssModuleImports.push(`import ${bindingName} from ${JSON.stringify(moduleUrl)};`);
|
|
188
|
-
}
|
|
189
|
-
} else styleImports.push(`import ${JSON.stringify(styleFile ?? `${filePath}?${params.toString()}`)};`);
|
|
224
|
+
} else cssModuleImports.push(`import ${bindingName} from ${JSON.stringify(styleId)};`);
|
|
225
|
+
} else styleImports.push(`import ${JSON.stringify(styleId)};`);
|
|
190
226
|
}
|
|
191
227
|
if (cssModuleImports.some((line) => line.includes(CSS_MODULE_LOCALS))) cssModuleImports.unshift(CSS_MODULE_LOCALS_HELPER);
|
|
192
228
|
const allImports = [...styleImports, ...cssModuleImports].join("\n");
|
|
@@ -467,59 +503,6 @@ function compileJsxModule(filePath, source, options) {
|
|
|
467
503
|
};
|
|
468
504
|
}
|
|
469
505
|
//#endregion
|
|
470
|
-
//#region src/request.ts
|
|
471
|
-
const STYLE_MARKER = ".__vize_style_";
|
|
472
|
-
function isVueFile(id) {
|
|
473
|
-
return id.endsWith(".vue");
|
|
474
|
-
}
|
|
475
|
-
function isJsxFile(id) {
|
|
476
|
-
return id.endsWith(".jsx") || id.endsWith(".tsx");
|
|
477
|
-
}
|
|
478
|
-
function isVueStyleRequest(id) {
|
|
479
|
-
if (!id.includes("?vue")) return false;
|
|
480
|
-
const { query } = parseVueRequest(id);
|
|
481
|
-
return query.vue && query.type === "style";
|
|
482
|
-
}
|
|
483
|
-
function isVirtualStyleId(id) {
|
|
484
|
-
return id.includes(STYLE_MARKER);
|
|
485
|
-
}
|
|
486
|
-
function parseVueRequest(id) {
|
|
487
|
-
const [path, rawQuery = ""] = id.split("?", 2);
|
|
488
|
-
const params = new URLSearchParams(rawQuery);
|
|
489
|
-
const filename = params.get("vize-file") ?? path;
|
|
490
|
-
const moduleValue = params.has("module") ? params.get("module") || true : false;
|
|
491
|
-
const indexValue = params.get("index");
|
|
492
|
-
return {
|
|
493
|
-
filename,
|
|
494
|
-
path,
|
|
495
|
-
query: {
|
|
496
|
-
vue: params.has("vue"),
|
|
497
|
-
type: params.get("type"),
|
|
498
|
-
index: indexValue === null ? null : Number.parseInt(indexValue, 10),
|
|
499
|
-
lang: params.get("lang"),
|
|
500
|
-
module: moduleValue,
|
|
501
|
-
scoped: params.get("scoped"),
|
|
502
|
-
vizeFile: params.get("vize-file")
|
|
503
|
-
}
|
|
504
|
-
};
|
|
505
|
-
}
|
|
506
|
-
function createVirtualStyleId(id) {
|
|
507
|
-
const { filename, query } = parseVueRequest(id);
|
|
508
|
-
const index = query.index ?? 0;
|
|
509
|
-
const lang = query.lang ?? "css";
|
|
510
|
-
const fileLang = query.scoped && isPreprocessorLang(lang) ? "css" : lang;
|
|
511
|
-
const suffix = query.module !== false ? `.module.${fileLang}` : `.${fileLang}`;
|
|
512
|
-
const params = new URLSearchParams();
|
|
513
|
-
params.set("vue", "");
|
|
514
|
-
params.set("type", "style");
|
|
515
|
-
params.set("index", String(index));
|
|
516
|
-
params.set("lang", lang);
|
|
517
|
-
params.set("vize-file", filename);
|
|
518
|
-
if (query.scoped) params.set("scoped", query.scoped);
|
|
519
|
-
if (query.module !== false) params.set("module", typeof query.module === "string" ? query.module : "");
|
|
520
|
-
return `${filename}${STYLE_MARKER}${index}${suffix}?${params.toString()}`;
|
|
521
|
-
}
|
|
522
|
-
//#endregion
|
|
523
506
|
//#region src/strip-types.ts
|
|
524
507
|
function formatErrorMessage(error) {
|
|
525
508
|
const parts = [error.message];
|
|
@@ -676,16 +659,15 @@ const vizeUnplugin = createUnplugin((rawOptions = {}, meta) => {
|
|
|
676
659
|
name: "unplugin-vize",
|
|
677
660
|
resolveId(id) {
|
|
678
661
|
if (options.hostCompiler) return null;
|
|
679
|
-
|
|
680
|
-
return null;
|
|
662
|
+
return isVueStyleRequest(id) ? id : null;
|
|
681
663
|
},
|
|
682
664
|
loadInclude(id) {
|
|
683
665
|
if (options.hostCompiler) return false;
|
|
684
|
-
return !webpackStyleFiles &&
|
|
666
|
+
return !webpackStyleFiles && isVueStyleRequest(id);
|
|
685
667
|
},
|
|
686
668
|
async load(id) {
|
|
687
669
|
if (options.hostCompiler) return null;
|
|
688
|
-
if (!
|
|
670
|
+
if (!isVueStyleRequest(id)) return null;
|
|
689
671
|
return {
|
|
690
672
|
code: await loadStyleBlock(this, id, options, cache),
|
|
691
673
|
map: null
|
|
@@ -741,7 +723,7 @@ const vizeUnplugin = createUnplugin((rawOptions = {}, meta) => {
|
|
|
741
723
|
},
|
|
742
724
|
esbuild: {
|
|
743
725
|
onResolveFilter: /\.(?:vue|[jt]sx)(?:$|\?)/,
|
|
744
|
-
onLoadFilter: /\.(?:vue|[jt]sx)(?:$|\?)
|
|
726
|
+
onLoadFilter: /\.(?:vue|[jt]sx)(?:$|\?)/,
|
|
745
727
|
loader(_code, id) {
|
|
746
728
|
const request = parseVueRequest(id);
|
|
747
729
|
if (request.query.type === "style") return request.query.module !== false ? "local-css" : "css";
|
|
@@ -95,6 +95,53 @@ function prependMappedJsxCode(code, mapJson, prefix) {
|
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
//#endregion
|
|
98
|
+
//#region src/request.ts
|
|
99
|
+
function isVueFile(id) {
|
|
100
|
+
return id.endsWith(".vue");
|
|
101
|
+
}
|
|
102
|
+
function isJsxFile(id) {
|
|
103
|
+
return id.endsWith(".jsx") || id.endsWith(".tsx");
|
|
104
|
+
}
|
|
105
|
+
function isVueStyleRequest(id) {
|
|
106
|
+
if (!id.includes("?vue")) return false;
|
|
107
|
+
const { query } = parseVueRequest(id);
|
|
108
|
+
return query.vue && query.type === "style";
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The module id of a delegated style block, in Vue's request shape:
|
|
112
|
+
* `App.vue?vue&type=style&index=0[&scoped=…][&module[=name]]&lang.<ext>`.
|
|
113
|
+
*
|
|
114
|
+
* CSS pipelines classify a module by the extension that ends the id, and treat
|
|
115
|
+
* a query on a stylesheet path as another import kind (`?raw`, `?inline`), so
|
|
116
|
+
* the path stays the SFC and `<ext>` names what `load` returns: a scoped
|
|
117
|
+
* preprocessor block is compiled before scoping, so it is CSS.
|
|
118
|
+
*/
|
|
119
|
+
function styleRequestId(filePath, block, scoped) {
|
|
120
|
+
const lang = block.lang ?? "css";
|
|
121
|
+
const delivered = scoped && require_webpack_styles.isPreprocessorLang(lang) ? "css" : lang;
|
|
122
|
+
let query = `vue&type=style&index=${block.index}`;
|
|
123
|
+
if (scoped) query += `&scoped=${encodeURIComponent(scoped)}`;
|
|
124
|
+
if (block.module !== false) query += typeof block.module === "string" ? `&module=${encodeURIComponent(block.module)}` : "&module";
|
|
125
|
+
const ext = block.module === false ? delivered : `module.${delivered}`;
|
|
126
|
+
return `${filePath}?${query}&lang.${ext}`;
|
|
127
|
+
}
|
|
128
|
+
function parseVueRequest(id) {
|
|
129
|
+
const [filename, rawQuery = ""] = id.split("?", 2);
|
|
130
|
+
const params = new URLSearchParams(rawQuery);
|
|
131
|
+
const moduleValue = params.has("module") ? params.get("module") || true : false;
|
|
132
|
+
const indexValue = params.get("index");
|
|
133
|
+
return {
|
|
134
|
+
filename,
|
|
135
|
+
query: {
|
|
136
|
+
vue: params.has("vue"),
|
|
137
|
+
type: params.get("type"),
|
|
138
|
+
index: indexValue === null ? null : Number.parseInt(indexValue, 10),
|
|
139
|
+
module: moduleValue,
|
|
140
|
+
scoped: params.get("scoped")
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
//#endregion
|
|
98
145
|
//#region src/style.ts
|
|
99
146
|
function needsPreprocessor(block) {
|
|
100
147
|
return require_webpack_styles.isPreprocessorLang(block.lang);
|
|
@@ -168,27 +215,16 @@ function generateOutput(compiled, options) {
|
|
|
168
215
|
const styleImports = [];
|
|
169
216
|
const cssModuleImports = [];
|
|
170
217
|
for (const block of compiled.styles) {
|
|
171
|
-
const lang = block.lang ?? "css";
|
|
172
|
-
const params = new URLSearchParams();
|
|
173
|
-
params.set("vue", "");
|
|
174
|
-
params.set("type", "style");
|
|
175
|
-
params.set("index", String(block.index));
|
|
176
|
-
params.set("lang", lang);
|
|
177
|
-
if (block.scoped) params.set("scoped", `data-v-${compiled.scopeId}`);
|
|
178
218
|
const scoped = block.scoped ? `data-v-${compiled.scopeId}` : null;
|
|
179
219
|
const styleFile = styleRequest?.(block, scoped);
|
|
220
|
+
const styleId = styleFile ?? styleRequestId(filePath, block, scoped);
|
|
180
221
|
if (isCssModule(block)) {
|
|
181
222
|
const bindingName = typeof block.module === "string" ? block.module : "$style";
|
|
182
223
|
if (styleFile) {
|
|
183
224
|
const namespace = `__vize_css_module_${block.index}__`;
|
|
184
225
|
cssModuleImports.push(`import * as ${namespace} from ${JSON.stringify(styleFile)};`, `const ${bindingName} = ${CSS_MODULE_LOCALS}(${namespace});`);
|
|
185
|
-
} else {
|
|
186
|
-
|
|
187
|
-
moduleParams.set("module", typeof block.module === "string" ? block.module : "");
|
|
188
|
-
const moduleUrl = `${filePath}?${moduleParams.toString()}`;
|
|
189
|
-
cssModuleImports.push(`import ${bindingName} from ${JSON.stringify(moduleUrl)};`);
|
|
190
|
-
}
|
|
191
|
-
} else styleImports.push(`import ${JSON.stringify(styleFile ?? `${filePath}?${params.toString()}`)};`);
|
|
226
|
+
} else cssModuleImports.push(`import ${bindingName} from ${JSON.stringify(styleId)};`);
|
|
227
|
+
} else styleImports.push(`import ${JSON.stringify(styleId)};`);
|
|
192
228
|
}
|
|
193
229
|
if (cssModuleImports.some((line) => line.includes(CSS_MODULE_LOCALS))) cssModuleImports.unshift(CSS_MODULE_LOCALS_HELPER);
|
|
194
230
|
const allImports = [...styleImports, ...cssModuleImports].join("\n");
|
|
@@ -469,59 +505,6 @@ function compileJsxModule(filePath, source, options) {
|
|
|
469
505
|
};
|
|
470
506
|
}
|
|
471
507
|
//#endregion
|
|
472
|
-
//#region src/request.ts
|
|
473
|
-
const STYLE_MARKER = ".__vize_style_";
|
|
474
|
-
function isVueFile(id) {
|
|
475
|
-
return id.endsWith(".vue");
|
|
476
|
-
}
|
|
477
|
-
function isJsxFile(id) {
|
|
478
|
-
return id.endsWith(".jsx") || id.endsWith(".tsx");
|
|
479
|
-
}
|
|
480
|
-
function isVueStyleRequest(id) {
|
|
481
|
-
if (!id.includes("?vue")) return false;
|
|
482
|
-
const { query } = parseVueRequest(id);
|
|
483
|
-
return query.vue && query.type === "style";
|
|
484
|
-
}
|
|
485
|
-
function isVirtualStyleId(id) {
|
|
486
|
-
return id.includes(STYLE_MARKER);
|
|
487
|
-
}
|
|
488
|
-
function parseVueRequest(id) {
|
|
489
|
-
const [path, rawQuery = ""] = id.split("?", 2);
|
|
490
|
-
const params = new URLSearchParams(rawQuery);
|
|
491
|
-
const filename = params.get("vize-file") ?? path;
|
|
492
|
-
const moduleValue = params.has("module") ? params.get("module") || true : false;
|
|
493
|
-
const indexValue = params.get("index");
|
|
494
|
-
return {
|
|
495
|
-
filename,
|
|
496
|
-
path,
|
|
497
|
-
query: {
|
|
498
|
-
vue: params.has("vue"),
|
|
499
|
-
type: params.get("type"),
|
|
500
|
-
index: indexValue === null ? null : Number.parseInt(indexValue, 10),
|
|
501
|
-
lang: params.get("lang"),
|
|
502
|
-
module: moduleValue,
|
|
503
|
-
scoped: params.get("scoped"),
|
|
504
|
-
vizeFile: params.get("vize-file")
|
|
505
|
-
}
|
|
506
|
-
};
|
|
507
|
-
}
|
|
508
|
-
function createVirtualStyleId(id) {
|
|
509
|
-
const { filename, query } = parseVueRequest(id);
|
|
510
|
-
const index = query.index ?? 0;
|
|
511
|
-
const lang = query.lang ?? "css";
|
|
512
|
-
const fileLang = query.scoped && require_webpack_styles.isPreprocessorLang(lang) ? "css" : lang;
|
|
513
|
-
const suffix = query.module !== false ? `.module.${fileLang}` : `.${fileLang}`;
|
|
514
|
-
const params = new URLSearchParams();
|
|
515
|
-
params.set("vue", "");
|
|
516
|
-
params.set("type", "style");
|
|
517
|
-
params.set("index", String(index));
|
|
518
|
-
params.set("lang", lang);
|
|
519
|
-
params.set("vize-file", filename);
|
|
520
|
-
if (query.scoped) params.set("scoped", query.scoped);
|
|
521
|
-
if (query.module !== false) params.set("module", typeof query.module === "string" ? query.module : "");
|
|
522
|
-
return `${filename}${STYLE_MARKER}${index}${suffix}?${params.toString()}`;
|
|
523
|
-
}
|
|
524
|
-
//#endregion
|
|
525
508
|
//#region src/strip-types.ts
|
|
526
509
|
function formatErrorMessage(error) {
|
|
527
510
|
const parts = [error.message];
|
|
@@ -678,16 +661,15 @@ const vizeUnplugin = (0, unplugin.createUnplugin)((rawOptions = {}, meta) => {
|
|
|
678
661
|
name: "unplugin-vize",
|
|
679
662
|
resolveId(id) {
|
|
680
663
|
if (options.hostCompiler) return null;
|
|
681
|
-
|
|
682
|
-
return null;
|
|
664
|
+
return isVueStyleRequest(id) ? id : null;
|
|
683
665
|
},
|
|
684
666
|
loadInclude(id) {
|
|
685
667
|
if (options.hostCompiler) return false;
|
|
686
|
-
return !webpackStyleFiles &&
|
|
668
|
+
return !webpackStyleFiles && isVueStyleRequest(id);
|
|
687
669
|
},
|
|
688
670
|
async load(id) {
|
|
689
671
|
if (options.hostCompiler) return null;
|
|
690
|
-
if (!
|
|
672
|
+
if (!isVueStyleRequest(id)) return null;
|
|
691
673
|
return {
|
|
692
674
|
code: await loadStyleBlock(this, id, options, cache),
|
|
693
675
|
map: null
|
|
@@ -743,7 +725,7 @@ const vizeUnplugin = (0, unplugin.createUnplugin)((rawOptions = {}, meta) => {
|
|
|
743
725
|
},
|
|
744
726
|
esbuild: {
|
|
745
727
|
onResolveFilter: /\.(?:vue|[jt]sx)(?:$|\?)/,
|
|
746
|
-
onLoadFilter: /\.(?:vue|[jt]sx)(?:$|\?)
|
|
728
|
+
onLoadFilter: /\.(?:vue|[jt]sx)(?:$|\?)/,
|
|
747
729
|
loader(_code, id) {
|
|
748
730
|
const request = parseVueRequest(id);
|
|
749
731
|
if (request.query.type === "style") return request.query.module !== false ? "local-css" : "css";
|
package/dist/webpack.cjs
CHANGED
package/dist/webpack.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizejs/unplugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.662.0",
|
|
4
4
|
"description": "Experimental Vue SFC integrations for Rollup, Rolldown, Webpack, esbuild, and Babel powered by Vize",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"babel",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"access": "public"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@vizejs/native": "0.
|
|
71
|
+
"@vizejs/native": "0.662.0",
|
|
72
72
|
"oxc-transform": "0.144.0",
|
|
73
73
|
"unplugin": "3.3.0"
|
|
74
74
|
},
|