@vuebro/loader-sfc 2.3.0 → 2.3.1
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.
|
@@ -23471,10 +23471,10 @@ const Ug = async (e) => {
|
|
|
23471
23471
|
const { lang: ae = "js" } = Y ?? {};
|
|
23472
23472
|
return [.../[jt]sx$/.test(ae) ? ["jsx"] : [], .../tsx?$/.test(ae) ? ["typescript"] : []];
|
|
23473
23473
|
})), { ast: b, content: E = "" } = y ?? {};
|
|
23474
|
-
let w;
|
|
23474
|
+
let w = "";
|
|
23475
23475
|
const C = [], A = document.getElementById(l) instanceof HTMLStyleElement ? Promise.resolve([]) : Promise.all(m.map(async ({ content: Y, module: ae, scoped: J = !1, src: $ }) => {
|
|
23476
23476
|
const ie = !!ae;
|
|
23477
|
-
if (ie) return w = "<style module> is not supported in the playground.", "";
|
|
23477
|
+
if (ie && !w) return w = "<style module> is not supported in the playground.", "";
|
|
23478
23478
|
{
|
|
23479
23479
|
const { code: Q, errors: se } = await m_({ filename: e, id: l, modules: ie, scoped: J, source: $ ? await (await Ug($)).text() : Y, ...c });
|
|
23480
23480
|
return C.push(...se), Q;
|
|
@@ -23482,7 +23482,13 @@ const Ug = async (e) => {
|
|
|
23482
23482
|
})), O = { expressionPlugins: [.../* @__PURE__ */ new Set([...s ?? [], ...T])], filename: e, scopeId: l, slotted: v, ...n }, D = { compilerOptions: O, filename: e, id: l, scoped: m.some(({ scoped: Y }) => Y), slotted: v, ...i }, N = { id: l, templateOptions: D, ...o }, j = { jsxRuntime: "preserve", transforms: [...T] }, { bindings: U, content: X, warnings: W } = g || f ? nP(p, N) : {};
|
|
23483
23483
|
U && (O.bindingMetadata = U);
|
|
23484
23484
|
const { code: V, errors: F, tips: q } = !y || f && N.inlineTemplate ? {} : Zb({ ...b, filename: e, id: l, source: E, ...D });
|
|
23485
|
-
|
|
23485
|
+
[...d, ...F ?? [], ...C].forEach((Y) => {
|
|
23486
|
+
pc.error(Y);
|
|
23487
|
+
}), [...W ?? [], ...w ? [w] : []].forEach((Y) => {
|
|
23488
|
+
pc.warn(Y);
|
|
23489
|
+
}), [...q ?? []].forEach((Y) => {
|
|
23490
|
+
pc.info(Y);
|
|
23491
|
+
});
|
|
23486
23492
|
const [G, ee, ce] = await Promise.all([A, X ? $g(T.size ? J1(X, j).code : X) : Promise.resolve(void 0), V ? $g(T.size ? J1(V, j).code : V) : Promise.resolve(void 0)]), be = G.join(`
|
|
23487
23493
|
`).trim();
|
|
23488
23494
|
if (be) {
|
package/dist/loader-sfc.js
CHANGED
|
@@ -48,12 +48,12 @@ export default async (filename, { parseOptions, scriptOptions: { templateOptions
|
|
|
48
48
|
/* -------------------------------------------------------------------------- */
|
|
49
49
|
/* Загрузка и компилирование стилей */
|
|
50
50
|
/* -------------------------------------------------------------------------- */
|
|
51
|
-
let styleWarning;
|
|
51
|
+
let styleWarning = "";
|
|
52
52
|
const styleErrors = [];
|
|
53
53
|
const style = !(document.getElementById(id) instanceof HTMLStyleElement)
|
|
54
54
|
? Promise.all(styles.map(async ({ content, module, scoped = false, src }) => {
|
|
55
55
|
const modules = !!module;
|
|
56
|
-
if (modules) {
|
|
56
|
+
if (modules && !styleWarning) {
|
|
57
57
|
styleWarning = "<style module> is not supported in the playground.";
|
|
58
58
|
return "";
|
|
59
59
|
}
|
|
@@ -121,9 +121,15 @@ export default async (filename, { parseOptions, scriptOptions: { templateOptions
|
|
|
121
121
|
/* -------------------------------------------------------------------------- */
|
|
122
122
|
/* Вывод ошибок, предупреждений и подсказок */
|
|
123
123
|
/* -------------------------------------------------------------------------- */
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
[...parseErrors, ...(templateErrors ?? []), ...styleErrors].forEach((error) => {
|
|
125
|
+
consola.error(error);
|
|
126
|
+
});
|
|
127
|
+
[...(scriptWarnings ?? []), ...(styleWarning ? [styleWarning] : [])].forEach((warn) => {
|
|
128
|
+
consola.warn(warn);
|
|
129
|
+
});
|
|
130
|
+
[...(templateTips ?? [])].forEach((info) => {
|
|
131
|
+
consola.info(info);
|
|
132
|
+
});
|
|
127
133
|
/* -------------------------------------------------------------------------- */
|
|
128
134
|
/* Получение и обработка результатов */
|
|
129
135
|
/* -------------------------------------------------------------------------- */
|
package/package.json
CHANGED