@forsakringskassan/vite-lib-config 5.15.2 → 5.15.3
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/vite.config.cjs +6 -17
- package/dist/vite.config.mjs +6 -17
- package/package.json +1 -1
package/dist/vite.config.cjs
CHANGED
|
@@ -4963,7 +4963,7 @@ var import_node_path = __toESM(require("node:path"), 1);
|
|
|
4963
4963
|
var import_node_crypto = __toESM(require("node:crypto"), 1);
|
|
4964
4964
|
var import_node_tty = require("node:tty");
|
|
4965
4965
|
var import_node_util = require("node:util");
|
|
4966
|
-
var version = "6.0.
|
|
4966
|
+
var version = "6.0.11";
|
|
4967
4967
|
function resolveCompiler(root) {
|
|
4968
4968
|
const compiler = tryResolveCompiler(root) || tryResolveCompiler();
|
|
4969
4969
|
if (!compiler) throw new Error("Failed to resolve vue/compiler-sfc.\n@vitejs/plugin-vue requires vue (>=3.2.25) to be present in the dependency tree.");
|
|
@@ -5095,8 +5095,6 @@ function canForceVaporMode(descriptor) {
|
|
|
5095
5095
|
async function transformTemplateAsModule(code2, filename, descriptor, options, pluginContext, ssr, customElement) {
|
|
5096
5096
|
const result = compile(code2, filename, descriptor, options, pluginContext, ssr, customElement);
|
|
5097
5097
|
let returnCode = result.code;
|
|
5098
|
-
returnCode += `
|
|
5099
|
-
export const multiRoot = ${JSON.stringify(result.multiRoot)}`;
|
|
5100
5098
|
if (options.devServer && options.devServer.config.server.hmr !== false && !ssr && !options.isProduction) returnCode += `
|
|
5101
5099
|
import.meta.hot.accept(({ render }) => {
|
|
5102
5100
|
__VUE_HMR_RUNTIME__.rerender(${JSON.stringify(descriptor.id)}, render)
|
|
@@ -6119,6 +6117,7 @@ async function handleHotUpdate({ file, modules, read }, options, customElement,
|
|
|
6119
6117
|
}
|
|
6120
6118
|
}
|
|
6121
6119
|
const updateType = [];
|
|
6120
|
+
if (scriptChanged) updateType.push(`script`);
|
|
6122
6121
|
if (needRerender) {
|
|
6123
6122
|
updateType.push(`template`);
|
|
6124
6123
|
if (!templateModule) affectedModules.add(mainModule);
|
|
@@ -6230,14 +6229,11 @@ async function transformMain(code2, filename, options, pluginContext, ssr, custo
|
|
|
6230
6229
|
}
|
|
6231
6230
|
const attachedProps = [];
|
|
6232
6231
|
const hasScoped = descriptor.styles.some((s) => s.scoped);
|
|
6233
|
-
const isTemplateOnlyVapor = !descriptor.script && !descriptor.scriptSetup && isVaporMode(descriptor, options);
|
|
6234
6232
|
const { code: scriptCode, map: scriptMap } = await genScriptCode(descriptor, options, pluginContext, ssr, customElement);
|
|
6235
6233
|
const hasTemplateImport = descriptor.template && !isUseInlineTemplate(descriptor, options);
|
|
6236
|
-
const isTemplateInlined = !!descriptor.template && (!descriptor.template.lang || descriptor.template.lang === "html") && !descriptor.template.src;
|
|
6237
6234
|
let templateCode = "";
|
|
6238
6235
|
let templateMap = void 0;
|
|
6239
|
-
|
|
6240
|
-
if (hasTemplateImport) ({ code: templateCode, map: templateMap, multiRoot: templateMultiRoot } = await genTemplateCode(descriptor, options, pluginContext, ssr, customElement));
|
|
6236
|
+
if (hasTemplateImport) ({ code: templateCode, map: templateMap } = await genTemplateCode(descriptor, options, pluginContext, ssr, customElement));
|
|
6241
6237
|
if (hasTemplateImport) attachedProps.push(ssr ? ["ssrRender", "_sfc_ssrRender"] : ["render", "_sfc_render"]);
|
|
6242
6238
|
else if (prevDescriptor && !isEqualBlock(descriptor.template, prevDescriptor.template)) attachedProps.push([ssr ? "ssrRender" : "render", "() => {}"]);
|
|
6243
6239
|
const stylesCode = await genStyleCode(descriptor, pluginContext, customElement, attachedProps);
|
|
@@ -6245,7 +6241,6 @@ async function transformMain(code2, filename, options, pluginContext, ssr, custo
|
|
|
6245
6241
|
const output = [
|
|
6246
6242
|
scriptCode,
|
|
6247
6243
|
templateCode,
|
|
6248
|
-
isTemplateOnlyVapor ? `${scriptIdentifier}.__multiRoot = ${isTemplateInlined ? templateMultiRoot : "_sfc_multiRoot"}` : "",
|
|
6249
6244
|
stylesCode,
|
|
6250
6245
|
customBlocksCode
|
|
6251
6246
|
];
|
|
@@ -6327,21 +6322,15 @@ async function transformMain(code2, filename, options, pluginContext, ssr, custo
|
|
|
6327
6322
|
async function genTemplateCode(descriptor, options, pluginContext, ssr, customElement) {
|
|
6328
6323
|
const template = descriptor.template;
|
|
6329
6324
|
const hasScoped = descriptor.styles.some((style) => style.scoped);
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
const result = transformTemplateInMain(template.content, descriptor, options, pluginContext, ssr, customElement);
|
|
6333
|
-
return {
|
|
6334
|
-
...result,
|
|
6335
|
-
multiRoot: needsMultiRoot ? result.multiRoot : void 0
|
|
6336
|
-
};
|
|
6337
|
-
} else {
|
|
6325
|
+
if ((!template.lang || template.lang === "html") && !template.src) return transformTemplateInMain(template.content, descriptor, options, pluginContext, ssr, customElement);
|
|
6326
|
+
else {
|
|
6338
6327
|
if (template.src) await linkSrcToDescriptor(template.src, descriptor, pluginContext, hasScoped);
|
|
6339
6328
|
const src = template.src || descriptor.filename;
|
|
6340
6329
|
const query2 = `?vue&type=template${template.src ? hasScoped ? `&src=${descriptor.id}` : "&src=true" : ""}${hasScoped ? `&scoped=${descriptor.id}` : ``}${attrsToQuery(template.attrs, "js", true)}`;
|
|
6341
6330
|
const request = JSON.stringify(src + query2);
|
|
6342
6331
|
const renderFnName = ssr ? "ssrRender" : "render";
|
|
6343
6332
|
return {
|
|
6344
|
-
code: `import { ${renderFnName} as _sfc_${renderFnName}
|
|
6333
|
+
code: `import { ${renderFnName} as _sfc_${renderFnName} } from ${request}`,
|
|
6345
6334
|
map: void 0
|
|
6346
6335
|
};
|
|
6347
6336
|
}
|
package/dist/vite.config.mjs
CHANGED
|
@@ -4955,7 +4955,7 @@ import path from "node:path";
|
|
|
4955
4955
|
import crypto from "node:crypto";
|
|
4956
4956
|
import { isatty } from "node:tty";
|
|
4957
4957
|
import { formatWithOptions, inspect } from "node:util";
|
|
4958
|
-
var version = "6.0.
|
|
4958
|
+
var version = "6.0.11";
|
|
4959
4959
|
function resolveCompiler(root) {
|
|
4960
4960
|
const compiler = tryResolveCompiler(root) || tryResolveCompiler();
|
|
4961
4961
|
if (!compiler) throw new Error("Failed to resolve vue/compiler-sfc.\n@vitejs/plugin-vue requires vue (>=3.2.25) to be present in the dependency tree.");
|
|
@@ -5087,8 +5087,6 @@ function canForceVaporMode(descriptor) {
|
|
|
5087
5087
|
async function transformTemplateAsModule(code2, filename, descriptor, options, pluginContext, ssr, customElement) {
|
|
5088
5088
|
const result = compile(code2, filename, descriptor, options, pluginContext, ssr, customElement);
|
|
5089
5089
|
let returnCode = result.code;
|
|
5090
|
-
returnCode += `
|
|
5091
|
-
export const multiRoot = ${JSON.stringify(result.multiRoot)}`;
|
|
5092
5090
|
if (options.devServer && options.devServer.config.server.hmr !== false && !ssr && !options.isProduction) returnCode += `
|
|
5093
5091
|
import.meta.hot.accept(({ render }) => {
|
|
5094
5092
|
__VUE_HMR_RUNTIME__.rerender(${JSON.stringify(descriptor.id)}, render)
|
|
@@ -6111,6 +6109,7 @@ async function handleHotUpdate({ file, modules, read }, options, customElement,
|
|
|
6111
6109
|
}
|
|
6112
6110
|
}
|
|
6113
6111
|
const updateType = [];
|
|
6112
|
+
if (scriptChanged) updateType.push(`script`);
|
|
6114
6113
|
if (needRerender) {
|
|
6115
6114
|
updateType.push(`template`);
|
|
6116
6115
|
if (!templateModule) affectedModules.add(mainModule);
|
|
@@ -6222,14 +6221,11 @@ async function transformMain(code2, filename, options, pluginContext, ssr, custo
|
|
|
6222
6221
|
}
|
|
6223
6222
|
const attachedProps = [];
|
|
6224
6223
|
const hasScoped = descriptor.styles.some((s) => s.scoped);
|
|
6225
|
-
const isTemplateOnlyVapor = !descriptor.script && !descriptor.scriptSetup && isVaporMode(descriptor, options);
|
|
6226
6224
|
const { code: scriptCode, map: scriptMap } = await genScriptCode(descriptor, options, pluginContext, ssr, customElement);
|
|
6227
6225
|
const hasTemplateImport = descriptor.template && !isUseInlineTemplate(descriptor, options);
|
|
6228
|
-
const isTemplateInlined = !!descriptor.template && (!descriptor.template.lang || descriptor.template.lang === "html") && !descriptor.template.src;
|
|
6229
6226
|
let templateCode = "";
|
|
6230
6227
|
let templateMap = void 0;
|
|
6231
|
-
|
|
6232
|
-
if (hasTemplateImport) ({ code: templateCode, map: templateMap, multiRoot: templateMultiRoot } = await genTemplateCode(descriptor, options, pluginContext, ssr, customElement));
|
|
6228
|
+
if (hasTemplateImport) ({ code: templateCode, map: templateMap } = await genTemplateCode(descriptor, options, pluginContext, ssr, customElement));
|
|
6233
6229
|
if (hasTemplateImport) attachedProps.push(ssr ? ["ssrRender", "_sfc_ssrRender"] : ["render", "_sfc_render"]);
|
|
6234
6230
|
else if (prevDescriptor && !isEqualBlock(descriptor.template, prevDescriptor.template)) attachedProps.push([ssr ? "ssrRender" : "render", "() => {}"]);
|
|
6235
6231
|
const stylesCode = await genStyleCode(descriptor, pluginContext, customElement, attachedProps);
|
|
@@ -6237,7 +6233,6 @@ async function transformMain(code2, filename, options, pluginContext, ssr, custo
|
|
|
6237
6233
|
const output = [
|
|
6238
6234
|
scriptCode,
|
|
6239
6235
|
templateCode,
|
|
6240
|
-
isTemplateOnlyVapor ? `${scriptIdentifier}.__multiRoot = ${isTemplateInlined ? templateMultiRoot : "_sfc_multiRoot"}` : "",
|
|
6241
6236
|
stylesCode,
|
|
6242
6237
|
customBlocksCode
|
|
6243
6238
|
];
|
|
@@ -6319,21 +6314,15 @@ async function transformMain(code2, filename, options, pluginContext, ssr, custo
|
|
|
6319
6314
|
async function genTemplateCode(descriptor, options, pluginContext, ssr, customElement) {
|
|
6320
6315
|
const template = descriptor.template;
|
|
6321
6316
|
const hasScoped = descriptor.styles.some((style) => style.scoped);
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
const result = transformTemplateInMain(template.content, descriptor, options, pluginContext, ssr, customElement);
|
|
6325
|
-
return {
|
|
6326
|
-
...result,
|
|
6327
|
-
multiRoot: needsMultiRoot ? result.multiRoot : void 0
|
|
6328
|
-
};
|
|
6329
|
-
} else {
|
|
6317
|
+
if ((!template.lang || template.lang === "html") && !template.src) return transformTemplateInMain(template.content, descriptor, options, pluginContext, ssr, customElement);
|
|
6318
|
+
else {
|
|
6330
6319
|
if (template.src) await linkSrcToDescriptor(template.src, descriptor, pluginContext, hasScoped);
|
|
6331
6320
|
const src = template.src || descriptor.filename;
|
|
6332
6321
|
const query2 = `?vue&type=template${template.src ? hasScoped ? `&src=${descriptor.id}` : "&src=true" : ""}${hasScoped ? `&scoped=${descriptor.id}` : ``}${attrsToQuery(template.attrs, "js", true)}`;
|
|
6333
6322
|
const request = JSON.stringify(src + query2);
|
|
6334
6323
|
const renderFnName = ssr ? "ssrRender" : "render";
|
|
6335
6324
|
return {
|
|
6336
|
-
code: `import { ${renderFnName} as _sfc_${renderFnName}
|
|
6325
|
+
code: `import { ${renderFnName} as _sfc_${renderFnName} } from ${request}`,
|
|
6337
6326
|
map: void 0
|
|
6338
6327
|
};
|
|
6339
6328
|
}
|