@forsakringskassan/vite-lib-config 5.7.0 → 5.7.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 +19 -6
- package/dist/vite.config.mjs +19 -6
- package/package.json +1 -1
package/dist/vite.config.cjs
CHANGED
|
@@ -11349,9 +11349,18 @@ function defineConfig(config = {}) {
|
|
|
11349
11349
|
return fkDefineConfig(mode, config);
|
|
11350
11350
|
});
|
|
11351
11351
|
}
|
|
11352
|
-
function
|
|
11353
|
-
const
|
|
11354
|
-
|
|
11352
|
+
function shouldUseCustomEntrypoint(options) {
|
|
11353
|
+
const { config, positional, mode } = options;
|
|
11354
|
+
if (mode !== "development") {
|
|
11355
|
+
return false;
|
|
11356
|
+
}
|
|
11357
|
+
if (process.env.CYPRESS) {
|
|
11358
|
+
return false;
|
|
11359
|
+
}
|
|
11360
|
+
if (positional.length === 0) {
|
|
11361
|
+
return false;
|
|
11362
|
+
}
|
|
11363
|
+
return !config.fk?.entrypoint;
|
|
11355
11364
|
}
|
|
11356
11365
|
async function fkDefineConfig(mode, config = {}) {
|
|
11357
11366
|
const argv = process.argv.slice(2);
|
|
@@ -11361,8 +11370,12 @@ async function fkDefineConfig(mode, config = {}) {
|
|
|
11361
11370
|
if (mocks.length > 0) {
|
|
11362
11371
|
defaultConfig.plugins.push((0, import_apimock_express.vitePlugin)(mocks));
|
|
11363
11372
|
}
|
|
11364
|
-
const
|
|
11365
|
-
|
|
11373
|
+
const useCustomEntrypoint = shouldUseCustomEntrypoint({
|
|
11374
|
+
config,
|
|
11375
|
+
positional,
|
|
11376
|
+
mode
|
|
11377
|
+
});
|
|
11378
|
+
if (useCustomEntrypoint) {
|
|
11366
11379
|
const entrypoint = await findEntrypoint(positional[0]);
|
|
11367
11380
|
config.fk.entrypoint = `/${entrypoint}`;
|
|
11368
11381
|
}
|
|
@@ -11392,7 +11405,7 @@ async function fkDefineConfig(mode, config = {}) {
|
|
|
11392
11405
|
"Bundled dependencies:",
|
|
11393
11406
|
prettyList(allDependencies, (it2) => isBundled(external2, it2))
|
|
11394
11407
|
);
|
|
11395
|
-
if (
|
|
11408
|
+
if (useCustomEntrypoint) {
|
|
11396
11409
|
console.log("Entrypoint:", config.fk.entrypoint);
|
|
11397
11410
|
}
|
|
11398
11411
|
console.groupEnd();
|
package/dist/vite.config.mjs
CHANGED
|
@@ -11343,9 +11343,18 @@ function defineConfig(config = {}) {
|
|
|
11343
11343
|
return fkDefineConfig(mode, config);
|
|
11344
11344
|
});
|
|
11345
11345
|
}
|
|
11346
|
-
function
|
|
11347
|
-
const
|
|
11348
|
-
|
|
11346
|
+
function shouldUseCustomEntrypoint(options) {
|
|
11347
|
+
const { config, positional, mode } = options;
|
|
11348
|
+
if (mode !== "development") {
|
|
11349
|
+
return false;
|
|
11350
|
+
}
|
|
11351
|
+
if (process.env.CYPRESS) {
|
|
11352
|
+
return false;
|
|
11353
|
+
}
|
|
11354
|
+
if (positional.length === 0) {
|
|
11355
|
+
return false;
|
|
11356
|
+
}
|
|
11357
|
+
return !config.fk?.entrypoint;
|
|
11349
11358
|
}
|
|
11350
11359
|
async function fkDefineConfig(mode, config = {}) {
|
|
11351
11360
|
const argv = process.argv.slice(2);
|
|
@@ -11355,8 +11364,12 @@ async function fkDefineConfig(mode, config = {}) {
|
|
|
11355
11364
|
if (mocks.length > 0) {
|
|
11356
11365
|
defaultConfig.plugins.push(apimockPlugin(mocks));
|
|
11357
11366
|
}
|
|
11358
|
-
const
|
|
11359
|
-
|
|
11367
|
+
const useCustomEntrypoint = shouldUseCustomEntrypoint({
|
|
11368
|
+
config,
|
|
11369
|
+
positional,
|
|
11370
|
+
mode
|
|
11371
|
+
});
|
|
11372
|
+
if (useCustomEntrypoint) {
|
|
11360
11373
|
const entrypoint = await findEntrypoint(positional[0]);
|
|
11361
11374
|
config.fk.entrypoint = `/${entrypoint}`;
|
|
11362
11375
|
}
|
|
@@ -11386,7 +11399,7 @@ async function fkDefineConfig(mode, config = {}) {
|
|
|
11386
11399
|
"Bundled dependencies:",
|
|
11387
11400
|
prettyList(allDependencies, (it2) => isBundled(external2, it2))
|
|
11388
11401
|
);
|
|
11389
|
-
if (
|
|
11402
|
+
if (useCustomEntrypoint) {
|
|
11390
11403
|
console.log("Entrypoint:", config.fk.entrypoint);
|
|
11391
11404
|
}
|
|
11392
11405
|
console.groupEnd();
|