@vuebro/loader-sfc 2.2.3 → 2.2.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/loader-sfc.d.ts +5 -6
- package/dist/loader-sfc.esm-browser.prod.js +1865 -1865
- package/dist/loader-sfc.js +4 -4
- package/package.json +1 -1
package/dist/loader-sfc.js
CHANGED
|
@@ -20,8 +20,8 @@ const fetchText = async (url) => {
|
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
/* -------------------------------------------------------------------------- */
|
|
23
|
-
export default async (filename,
|
|
24
|
-
const styleErrors = [], { descriptor, errors: parseErrors } = parse((await (await fetchText(filename)).text()) || "<template></template>",
|
|
23
|
+
export default async (filename, { parseOptions, scriptOptions: { templateOptions: { compilerOptions: { expressionPlugins, ...restCompilerOptions } = {}, ...restTemplateOptions } = {}, ...restScriptOptions } = {}, styleOptions, } = {}) => {
|
|
24
|
+
const styleErrors = [], { descriptor, errors: parseErrors } = parse((await (await fetchText(filename)).text()) || "<template></template>", parseOptions), { script, scriptSetup, slotted, styles, template } = descriptor;
|
|
25
25
|
let moduleWarning = "";
|
|
26
26
|
const id = `data-v-${hash(filename)}`, langs = new Set([script, scriptSetup].flatMap((scriptBlock) => {
|
|
27
27
|
const { lang = "js" } = scriptBlock ?? {};
|
|
@@ -44,7 +44,7 @@ export default async (filename, options) => {
|
|
|
44
44
|
}, scriptOptions = {
|
|
45
45
|
id,
|
|
46
46
|
templateOptions,
|
|
47
|
-
...
|
|
47
|
+
...restScriptOptions,
|
|
48
48
|
}, style = !(document.getElementById(id) instanceof HTMLStyleElement)
|
|
49
49
|
? Promise.all(styles.map(async ({ content, module, scoped = false, src }) => {
|
|
50
50
|
const modules = !!module;
|
|
@@ -60,7 +60,7 @@ export default async (filename, options) => {
|
|
|
60
60
|
modules,
|
|
61
61
|
scoped,
|
|
62
62
|
source: src ? await (await fetchText(src)).text() : content,
|
|
63
|
-
...
|
|
63
|
+
...styleOptions,
|
|
64
64
|
});
|
|
65
65
|
styleErrors.push(...errors);
|
|
66
66
|
return code;
|
package/package.json
CHANGED