@forsakringskassan/vite-lib-config 5.2.0 → 5.2.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.
- package/dist/vite.config.cjs +33 -14
- package/dist/vite.config.mjs +33 -14
- package/package.json +1 -1
package/dist/vite.config.cjs
CHANGED
|
@@ -4732,7 +4732,7 @@ var import_node_path = __toESM(require("node:path"), 1);
|
|
|
4732
4732
|
var import_node_crypto = __toESM(require("node:crypto"), 1);
|
|
4733
4733
|
var import_node_tty = require("node:tty");
|
|
4734
4734
|
var import_node_util = require("node:util");
|
|
4735
|
-
var version = "6.0.
|
|
4735
|
+
var version = "6.0.8";
|
|
4736
4736
|
function resolveCompiler(root) {
|
|
4737
4737
|
const compiler = tryResolveCompiler(root) || tryResolveCompiler();
|
|
4738
4738
|
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.");
|
|
@@ -4849,6 +4849,18 @@ function createRollupError(id2, error) {
|
|
|
4849
4849
|
};
|
|
4850
4850
|
return rollupError;
|
|
4851
4851
|
}
|
|
4852
|
+
function isVaporMode(descriptor, options) {
|
|
4853
|
+
if (descriptor.vapor) return true;
|
|
4854
|
+
if (options.features?.vapor) return canForceVaporMode(descriptor);
|
|
4855
|
+
return false;
|
|
4856
|
+
}
|
|
4857
|
+
function canForceVaporMode(descriptor) {
|
|
4858
|
+
if (descriptor.filename.endsWith(".vue")) {
|
|
4859
|
+
if (descriptor.scriptSetup) return true;
|
|
4860
|
+
if (descriptor.script) return false;
|
|
4861
|
+
}
|
|
4862
|
+
return true;
|
|
4863
|
+
}
|
|
4852
4864
|
async function transformTemplateAsModule(code2, filename, descriptor, options, pluginContext, ssr, customElement) {
|
|
4853
4865
|
const result = compile(code2, filename, descriptor, options, pluginContext, ssr, customElement);
|
|
4854
4866
|
let returnCode = result.code;
|
|
@@ -4923,7 +4935,7 @@ function resolveTemplateCompilerOptions(descriptor, options, filename, ssr) {
|
|
|
4923
4935
|
if (lang && /tsx?$/.test(lang) && !expressionPlugins.includes("typescript")) expressionPlugins.push("typescript");
|
|
4924
4936
|
return {
|
|
4925
4937
|
...options.template,
|
|
4926
|
-
vapor: descriptor
|
|
4938
|
+
vapor: isVaporMode(descriptor, options),
|
|
4927
4939
|
id: id2,
|
|
4928
4940
|
ast: canReuseAST(options.compiler.version) ? descriptor.template?.ast : void 0,
|
|
4929
4941
|
filename,
|
|
@@ -4989,6 +5001,7 @@ function resolveScript(descriptor, options, ssr, customElement) {
|
|
|
4989
5001
|
sourceMap: options.sourceMap,
|
|
4990
5002
|
genDefaultAs: canInlineMain(descriptor, options) ? scriptIdentifier : void 0,
|
|
4991
5003
|
customElement,
|
|
5004
|
+
vapor: isVaporMode(descriptor, options),
|
|
4992
5005
|
propsDestructure: options.features?.propsDestructure ?? options.script?.propsDestructure
|
|
4993
5006
|
});
|
|
4994
5007
|
if (!options.isProduction && resolved?.deps) {
|
|
@@ -5012,8 +5025,8 @@ function canInlineMain(descriptor, options) {
|
|
|
5012
5025
|
var comma = ",".charCodeAt(0);
|
|
5013
5026
|
var semicolon = ";".charCodeAt(0);
|
|
5014
5027
|
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
5015
|
-
var intToChar = new Uint8Array(64);
|
|
5016
|
-
var charToInt = new Uint8Array(128);
|
|
5028
|
+
var intToChar = /* @__PURE__ */ new Uint8Array(64);
|
|
5029
|
+
var charToInt = /* @__PURE__ */ new Uint8Array(128);
|
|
5017
5030
|
for (let i = 0; i < chars.length; i++) {
|
|
5018
5031
|
const c = chars.charCodeAt(i);
|
|
5019
5032
|
intToChar[i] = c;
|
|
@@ -5624,8 +5637,8 @@ function createDebug$1(namespace, options) {
|
|
|
5624
5637
|
options.formatArgs.call(debug2, diff, args);
|
|
5625
5638
|
debug2.log(...args);
|
|
5626
5639
|
};
|
|
5627
|
-
debug2.extend = function(
|
|
5628
|
-
return createDebug$1(this.namespace + delimiter +
|
|
5640
|
+
debug2.extend = function(namespace2, delimiter = ":") {
|
|
5641
|
+
return createDebug$1(this.namespace + delimiter + namespace2, {
|
|
5629
5642
|
useColors: this.useColors,
|
|
5630
5643
|
color: this.color,
|
|
5631
5644
|
formatArgs: this.formatArgs,
|
|
@@ -5656,8 +5669,8 @@ function createDebug$1(namespace, options) {
|
|
|
5656
5669
|
}
|
|
5657
5670
|
var names = [];
|
|
5658
5671
|
var skips = [];
|
|
5659
|
-
function enable(namespaces
|
|
5660
|
-
globalNamespaces = namespaces
|
|
5672
|
+
function enable(namespaces) {
|
|
5673
|
+
globalNamespaces = namespaces;
|
|
5661
5674
|
names = [];
|
|
5662
5675
|
skips = [];
|
|
5663
5676
|
const split = globalNamespaces.trim().replace(/\s+/g, ",").split(",").filter(Boolean);
|
|
@@ -5764,7 +5777,7 @@ var inspectOpts = Object.keys(process.env).filter((key) => /^debug_/i.test(key))
|
|
|
5764
5777
|
else value = Number(value);
|
|
5765
5778
|
obj[prop] = value;
|
|
5766
5779
|
return obj;
|
|
5767
|
-
},
|
|
5780
|
+
}, /* @__PURE__ */ Object.create(null));
|
|
5768
5781
|
function useColors() {
|
|
5769
5782
|
return "colors" in inspectOpts ? Boolean(inspectOpts.colors) : (0, import_node_tty.isatty)(process.stderr.fd);
|
|
5770
5783
|
}
|
|
@@ -5773,8 +5786,8 @@ function getDate() {
|
|
|
5773
5786
|
return `${(/* @__PURE__ */ new Date()).toISOString()} `;
|
|
5774
5787
|
}
|
|
5775
5788
|
function formatArgs(diff, args) {
|
|
5776
|
-
const { namespace: name, useColors:
|
|
5777
|
-
if (
|
|
5789
|
+
const { namespace: name, useColors: useColors2 } = this;
|
|
5790
|
+
if (useColors2) {
|
|
5778
5791
|
const c = this.color;
|
|
5779
5792
|
const colorCode = `\x1B[3${c < 8 ? c : `8;5;${c}`}`;
|
|
5780
5793
|
const prefix = ` ${colorCode};1m${name} \x1B[0m`;
|
|
@@ -5791,10 +5804,16 @@ var defaultOptions = {
|
|
|
5791
5804
|
useColors: useColors(),
|
|
5792
5805
|
formatArgs,
|
|
5793
5806
|
formatters: {
|
|
5807
|
+
/**
|
|
5808
|
+
* Map %o to `util.inspect()`, all on a single line.
|
|
5809
|
+
*/
|
|
5794
5810
|
o(v2) {
|
|
5795
5811
|
this.inspectOpts.colors = this.useColors;
|
|
5796
5812
|
return (0, import_node_util.inspect)(v2, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
|
|
5797
5813
|
},
|
|
5814
|
+
/**
|
|
5815
|
+
* Map %O to `util.inspect()`, allowing multiple lines if needed.
|
|
5816
|
+
*/
|
|
5798
5817
|
O(v2) {
|
|
5799
5818
|
this.inspectOpts.colors = this.useColors;
|
|
5800
5819
|
return (0, import_node_util.inspect)(v2, this.inspectOpts);
|
|
@@ -5973,7 +5992,7 @@ async function transformMain(code2, filename, options, pluginContext, ssr, custo
|
|
|
5973
5992
|
}
|
|
5974
5993
|
const attachedProps = [];
|
|
5975
5994
|
const hasScoped = descriptor.styles.some((s) => s.scoped);
|
|
5976
|
-
const isTemplateOnlyVapor = !descriptor.script && !descriptor.scriptSetup && descriptor
|
|
5995
|
+
const isTemplateOnlyVapor = !descriptor.script && !descriptor.scriptSetup && isVaporMode(descriptor, options);
|
|
5977
5996
|
const { code: scriptCode, map: scriptMap } = await genScriptCode(descriptor, options, pluginContext, ssr, customElement);
|
|
5978
5997
|
const hasTemplateImport = descriptor.template && !isUseInlineTemplate(descriptor, options);
|
|
5979
5998
|
const isTemplateInlined = !!descriptor.template && (!descriptor.template.lang || descriptor.template.lang === "html") && !descriptor.template.src;
|
|
@@ -6070,7 +6089,7 @@ async function transformMain(code2, filename, options, pluginContext, ssr, custo
|
|
|
6070
6089
|
async function genTemplateCode(descriptor, options, pluginContext, ssr, customElement) {
|
|
6071
6090
|
const template = descriptor.template;
|
|
6072
6091
|
const hasScoped = descriptor.styles.some((style) => style.scoped);
|
|
6073
|
-
const needsMultiRoot = !descriptor.script && !descriptor.scriptSetup && descriptor
|
|
6092
|
+
const needsMultiRoot = !descriptor.script && !descriptor.scriptSetup && isVaporMode(descriptor, options);
|
|
6074
6093
|
if ((!template.lang || template.lang === "html") && !template.src) {
|
|
6075
6094
|
const result = transformTemplateInMain(template.content, descriptor, options, pluginContext, ssr, customElement);
|
|
6076
6095
|
return {
|
|
@@ -6090,7 +6109,7 @@ async function genTemplateCode(descriptor, options, pluginContext, ssr, customEl
|
|
|
6090
6109
|
}
|
|
6091
6110
|
}
|
|
6092
6111
|
async function genScriptCode(descriptor, options, pluginContext, ssr, customElement) {
|
|
6093
|
-
let scriptCode = `const ${scriptIdentifier} = { ${descriptor
|
|
6112
|
+
let scriptCode = `const ${scriptIdentifier} = { ${isVaporMode(descriptor, options) ? "__vapor: true" : ""} }`;
|
|
6094
6113
|
let map;
|
|
6095
6114
|
const script = resolveScript(descriptor, options, ssr, customElement);
|
|
6096
6115
|
if (script) if (canInlineMain(descriptor, options)) {
|
package/dist/vite.config.mjs
CHANGED
|
@@ -4724,7 +4724,7 @@ import path from "node:path";
|
|
|
4724
4724
|
import crypto from "node:crypto";
|
|
4725
4725
|
import { isatty } from "node:tty";
|
|
4726
4726
|
import { formatWithOptions, inspect } from "node:util";
|
|
4727
|
-
var version = "6.0.
|
|
4727
|
+
var version = "6.0.8";
|
|
4728
4728
|
function resolveCompiler(root) {
|
|
4729
4729
|
const compiler = tryResolveCompiler(root) || tryResolveCompiler();
|
|
4730
4730
|
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.");
|
|
@@ -4841,6 +4841,18 @@ function createRollupError(id2, error) {
|
|
|
4841
4841
|
};
|
|
4842
4842
|
return rollupError;
|
|
4843
4843
|
}
|
|
4844
|
+
function isVaporMode(descriptor, options) {
|
|
4845
|
+
if (descriptor.vapor) return true;
|
|
4846
|
+
if (options.features?.vapor) return canForceVaporMode(descriptor);
|
|
4847
|
+
return false;
|
|
4848
|
+
}
|
|
4849
|
+
function canForceVaporMode(descriptor) {
|
|
4850
|
+
if (descriptor.filename.endsWith(".vue")) {
|
|
4851
|
+
if (descriptor.scriptSetup) return true;
|
|
4852
|
+
if (descriptor.script) return false;
|
|
4853
|
+
}
|
|
4854
|
+
return true;
|
|
4855
|
+
}
|
|
4844
4856
|
async function transformTemplateAsModule(code2, filename, descriptor, options, pluginContext, ssr, customElement) {
|
|
4845
4857
|
const result = compile(code2, filename, descriptor, options, pluginContext, ssr, customElement);
|
|
4846
4858
|
let returnCode = result.code;
|
|
@@ -4915,7 +4927,7 @@ function resolveTemplateCompilerOptions(descriptor, options, filename, ssr) {
|
|
|
4915
4927
|
if (lang && /tsx?$/.test(lang) && !expressionPlugins.includes("typescript")) expressionPlugins.push("typescript");
|
|
4916
4928
|
return {
|
|
4917
4929
|
...options.template,
|
|
4918
|
-
vapor: descriptor
|
|
4930
|
+
vapor: isVaporMode(descriptor, options),
|
|
4919
4931
|
id: id2,
|
|
4920
4932
|
ast: canReuseAST(options.compiler.version) ? descriptor.template?.ast : void 0,
|
|
4921
4933
|
filename,
|
|
@@ -4981,6 +4993,7 @@ function resolveScript(descriptor, options, ssr, customElement) {
|
|
|
4981
4993
|
sourceMap: options.sourceMap,
|
|
4982
4994
|
genDefaultAs: canInlineMain(descriptor, options) ? scriptIdentifier : void 0,
|
|
4983
4995
|
customElement,
|
|
4996
|
+
vapor: isVaporMode(descriptor, options),
|
|
4984
4997
|
propsDestructure: options.features?.propsDestructure ?? options.script?.propsDestructure
|
|
4985
4998
|
});
|
|
4986
4999
|
if (!options.isProduction && resolved?.deps) {
|
|
@@ -5004,8 +5017,8 @@ function canInlineMain(descriptor, options) {
|
|
|
5004
5017
|
var comma = ",".charCodeAt(0);
|
|
5005
5018
|
var semicolon = ";".charCodeAt(0);
|
|
5006
5019
|
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
5007
|
-
var intToChar = new Uint8Array(64);
|
|
5008
|
-
var charToInt = new Uint8Array(128);
|
|
5020
|
+
var intToChar = /* @__PURE__ */ new Uint8Array(64);
|
|
5021
|
+
var charToInt = /* @__PURE__ */ new Uint8Array(128);
|
|
5009
5022
|
for (let i = 0; i < chars.length; i++) {
|
|
5010
5023
|
const c = chars.charCodeAt(i);
|
|
5011
5024
|
intToChar[i] = c;
|
|
@@ -5616,8 +5629,8 @@ function createDebug$1(namespace, options) {
|
|
|
5616
5629
|
options.formatArgs.call(debug2, diff, args);
|
|
5617
5630
|
debug2.log(...args);
|
|
5618
5631
|
};
|
|
5619
|
-
debug2.extend = function(
|
|
5620
|
-
return createDebug$1(this.namespace + delimiter +
|
|
5632
|
+
debug2.extend = function(namespace2, delimiter = ":") {
|
|
5633
|
+
return createDebug$1(this.namespace + delimiter + namespace2, {
|
|
5621
5634
|
useColors: this.useColors,
|
|
5622
5635
|
color: this.color,
|
|
5623
5636
|
formatArgs: this.formatArgs,
|
|
@@ -5648,8 +5661,8 @@ function createDebug$1(namespace, options) {
|
|
|
5648
5661
|
}
|
|
5649
5662
|
var names = [];
|
|
5650
5663
|
var skips = [];
|
|
5651
|
-
function enable(namespaces
|
|
5652
|
-
globalNamespaces = namespaces
|
|
5664
|
+
function enable(namespaces) {
|
|
5665
|
+
globalNamespaces = namespaces;
|
|
5653
5666
|
names = [];
|
|
5654
5667
|
skips = [];
|
|
5655
5668
|
const split = globalNamespaces.trim().replace(/\s+/g, ",").split(",").filter(Boolean);
|
|
@@ -5756,7 +5769,7 @@ var inspectOpts = Object.keys(process.env).filter((key) => /^debug_/i.test(key))
|
|
|
5756
5769
|
else value = Number(value);
|
|
5757
5770
|
obj[prop] = value;
|
|
5758
5771
|
return obj;
|
|
5759
|
-
},
|
|
5772
|
+
}, /* @__PURE__ */ Object.create(null));
|
|
5760
5773
|
function useColors() {
|
|
5761
5774
|
return "colors" in inspectOpts ? Boolean(inspectOpts.colors) : isatty(process.stderr.fd);
|
|
5762
5775
|
}
|
|
@@ -5765,8 +5778,8 @@ function getDate() {
|
|
|
5765
5778
|
return `${(/* @__PURE__ */ new Date()).toISOString()} `;
|
|
5766
5779
|
}
|
|
5767
5780
|
function formatArgs(diff, args) {
|
|
5768
|
-
const { namespace: name, useColors:
|
|
5769
|
-
if (
|
|
5781
|
+
const { namespace: name, useColors: useColors2 } = this;
|
|
5782
|
+
if (useColors2) {
|
|
5770
5783
|
const c = this.color;
|
|
5771
5784
|
const colorCode = `\x1B[3${c < 8 ? c : `8;5;${c}`}`;
|
|
5772
5785
|
const prefix = ` ${colorCode};1m${name} \x1B[0m`;
|
|
@@ -5783,10 +5796,16 @@ var defaultOptions = {
|
|
|
5783
5796
|
useColors: useColors(),
|
|
5784
5797
|
formatArgs,
|
|
5785
5798
|
formatters: {
|
|
5799
|
+
/**
|
|
5800
|
+
* Map %o to `util.inspect()`, all on a single line.
|
|
5801
|
+
*/
|
|
5786
5802
|
o(v2) {
|
|
5787
5803
|
this.inspectOpts.colors = this.useColors;
|
|
5788
5804
|
return inspect(v2, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
|
|
5789
5805
|
},
|
|
5806
|
+
/**
|
|
5807
|
+
* Map %O to `util.inspect()`, allowing multiple lines if needed.
|
|
5808
|
+
*/
|
|
5790
5809
|
O(v2) {
|
|
5791
5810
|
this.inspectOpts.colors = this.useColors;
|
|
5792
5811
|
return inspect(v2, this.inspectOpts);
|
|
@@ -5965,7 +5984,7 @@ async function transformMain(code2, filename, options, pluginContext, ssr, custo
|
|
|
5965
5984
|
}
|
|
5966
5985
|
const attachedProps = [];
|
|
5967
5986
|
const hasScoped = descriptor.styles.some((s) => s.scoped);
|
|
5968
|
-
const isTemplateOnlyVapor = !descriptor.script && !descriptor.scriptSetup && descriptor
|
|
5987
|
+
const isTemplateOnlyVapor = !descriptor.script && !descriptor.scriptSetup && isVaporMode(descriptor, options);
|
|
5969
5988
|
const { code: scriptCode, map: scriptMap } = await genScriptCode(descriptor, options, pluginContext, ssr, customElement);
|
|
5970
5989
|
const hasTemplateImport = descriptor.template && !isUseInlineTemplate(descriptor, options);
|
|
5971
5990
|
const isTemplateInlined = !!descriptor.template && (!descriptor.template.lang || descriptor.template.lang === "html") && !descriptor.template.src;
|
|
@@ -6062,7 +6081,7 @@ async function transformMain(code2, filename, options, pluginContext, ssr, custo
|
|
|
6062
6081
|
async function genTemplateCode(descriptor, options, pluginContext, ssr, customElement) {
|
|
6063
6082
|
const template = descriptor.template;
|
|
6064
6083
|
const hasScoped = descriptor.styles.some((style) => style.scoped);
|
|
6065
|
-
const needsMultiRoot = !descriptor.script && !descriptor.scriptSetup && descriptor
|
|
6084
|
+
const needsMultiRoot = !descriptor.script && !descriptor.scriptSetup && isVaporMode(descriptor, options);
|
|
6066
6085
|
if ((!template.lang || template.lang === "html") && !template.src) {
|
|
6067
6086
|
const result = transformTemplateInMain(template.content, descriptor, options, pluginContext, ssr, customElement);
|
|
6068
6087
|
return {
|
|
@@ -6082,7 +6101,7 @@ async function genTemplateCode(descriptor, options, pluginContext, ssr, customEl
|
|
|
6082
6101
|
}
|
|
6083
6102
|
}
|
|
6084
6103
|
async function genScriptCode(descriptor, options, pluginContext, ssr, customElement) {
|
|
6085
|
-
let scriptCode = `const ${scriptIdentifier} = { ${descriptor
|
|
6104
|
+
let scriptCode = `const ${scriptIdentifier} = { ${isVaporMode(descriptor, options) ? "__vapor: true" : ""} }`;
|
|
6086
6105
|
let map;
|
|
6087
6106
|
const script = resolveScript(descriptor, options, ssr, customElement);
|
|
6088
6107
|
if (script) if (canInlineMain(descriptor, options)) {
|