@forsakringskassan/vite-lib-config 2.1.0 → 2.2.0

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.
@@ -214,7 +214,7 @@ var require_dist = __commonJS({
214
214
  var vite = __require("vite");
215
215
  var vue = __require("vue");
216
216
  var node_module = __require("node:module");
217
- var path5 = __require("node:path");
217
+ var path4 = __require("node:path");
218
218
  var node_crypto = __require("node:crypto");
219
219
  var require$$0 = __require("tty");
220
220
  var require$$1 = __require("util");
@@ -223,7 +223,7 @@ var require_dist = __commonJS({
223
223
  return e && typeof e === "object" && "default" in e ? e.default : e;
224
224
  }
225
225
  var fs__default = /* @__PURE__ */ _interopDefaultCompat(fs4);
226
- var path__default = /* @__PURE__ */ _interopDefaultCompat(path5);
226
+ var path__default = /* @__PURE__ */ _interopDefaultCompat(path4);
227
227
  var require$$0__default = /* @__PURE__ */ _interopDefaultCompat(require$$0);
228
228
  var require$$1__default = /* @__PURE__ */ _interopDefaultCompat(require$$1);
229
229
  var version2 = "4.6.2";
@@ -273,12 +273,12 @@ var require_dist = __commonJS({
273
273
  query
274
274
  };
275
275
  }
276
- function slash(path6) {
277
- const isExtendedLengthPath = path6.startsWith("\\\\?\\");
276
+ function slash(path5) {
277
+ const isExtendedLengthPath = path5.startsWith("\\\\?\\");
278
278
  if (isExtendedLengthPath) {
279
- return path6;
279
+ return path5;
280
280
  }
281
- return path6.replace(/\\/g, "/");
281
+ return path5.replace(/\\/g, "/");
282
282
  }
283
283
  var cache = /* @__PURE__ */ new Map();
284
284
  var hmrCache = /* @__PURE__ */ new Map();
@@ -772,16 +772,16 @@ import.meta.hot.accept(({ render }) => {
772
772
  }
773
773
  function parseFileUrl(input) {
774
774
  const match2 = fileRegex.exec(input);
775
- const path6 = match2[2];
776
- return makeUrl("file:", "", match2[1] || "", "", isAbsolutePath(path6) ? path6 : "/" + path6, match2[3] || "", match2[4] || "");
775
+ const path5 = match2[2];
776
+ return makeUrl("file:", "", match2[1] || "", "", isAbsolutePath(path5) ? path5 : "/" + path5, match2[3] || "", match2[4] || "");
777
777
  }
778
- function makeUrl(scheme, user, host, port, path6, query, hash) {
778
+ function makeUrl(scheme, user, host, port, path5, query, hash) {
779
779
  return {
780
780
  scheme,
781
781
  user,
782
782
  host,
783
783
  port,
784
- path: path6,
784
+ path: path5,
785
785
  query,
786
786
  hash,
787
787
  type: UrlType.Absolute
@@ -811,11 +811,11 @@ import.meta.hot.accept(({ render }) => {
811
811
  url.type = input ? input.startsWith("?") ? UrlType.Query : input.startsWith("#") ? UrlType.Hash : UrlType.RelativePath : UrlType.Empty;
812
812
  return url;
813
813
  }
814
- function stripPathFilename(path6) {
815
- if (path6.endsWith("/.."))
816
- return path6;
817
- const index = path6.lastIndexOf("/");
818
- return path6.slice(0, index + 1);
814
+ function stripPathFilename(path5) {
815
+ if (path5.endsWith("/.."))
816
+ return path5;
817
+ const index = path5.lastIndexOf("/");
818
+ return path5.slice(0, index + 1);
819
819
  }
820
820
  function mergePaths(url, base) {
821
821
  normalizePath(base, base.type);
@@ -853,14 +853,14 @@ import.meta.hot.accept(({ render }) => {
853
853
  pieces[pointer++] = piece;
854
854
  positive++;
855
855
  }
856
- let path6 = "";
856
+ let path5 = "";
857
857
  for (let i = 1; i < pointer; i++) {
858
- path6 += "/" + pieces[i];
858
+ path5 += "/" + pieces[i];
859
859
  }
860
- if (!path6 || addTrailingSlash && !path6.endsWith("/..")) {
861
- path6 += "/";
860
+ if (!path5 || addTrailingSlash && !path5.endsWith("/..")) {
861
+ path5 += "/";
862
862
  }
863
- url.path = path6;
863
+ url.path = path5;
864
864
  }
865
865
  function resolve$1(input, base) {
866
866
  if (!input && !base)
@@ -901,13 +901,13 @@ import.meta.hot.accept(({ render }) => {
901
901
  case UrlType.Query:
902
902
  return queryHash;
903
903
  case UrlType.RelativePath: {
904
- const path6 = url.path.slice(1);
905
- if (!path6)
904
+ const path5 = url.path.slice(1);
905
+ if (!path5)
906
906
  return queryHash || ".";
907
- if (isRelative(base || input) && !isRelative(path6)) {
908
- return "./" + path6 + queryHash;
907
+ if (isRelative(base || input) && !isRelative(path5)) {
908
+ return "./" + path5 + queryHash;
909
909
  }
910
- return path6 + queryHash;
910
+ return path5 + queryHash;
911
911
  }
912
912
  case UrlType.AbsolutePath:
913
913
  return url.path + queryHash;
@@ -920,11 +920,11 @@ import.meta.hot.accept(({ render }) => {
920
920
  base += "/";
921
921
  return resolve$1(input, base);
922
922
  }
923
- function stripFilename(path6) {
924
- if (!path6)
923
+ function stripFilename(path5) {
924
+ if (!path5)
925
925
  return "";
926
- const index = path6.lastIndexOf("/");
927
- return path6.slice(0, index + 1);
926
+ const index = path5.lastIndexOf("/");
927
+ return path5.slice(0, index + 1);
928
928
  }
929
929
  var COLUMN$1 = 0;
930
930
  function maybeSort(mappings, owned) {
@@ -2416,7 +2416,7 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
2416
2416
  cssDevSourcemap: false,
2417
2417
  devToolsEnabled: process.env.NODE_ENV !== "production"
2418
2418
  });
2419
- const filter2 = vue.computed(
2419
+ const filter3 = vue.computed(
2420
2420
  () => vite.createFilter(options.value.include, options.value.exclude)
2421
2421
  );
2422
2422
  const customElementFilter = vue.computed(
@@ -2443,7 +2443,7 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
2443
2443
  if (typeDepToSFCMap.has(ctx.file)) {
2444
2444
  return handleTypeDepChange(typeDepToSFCMap.get(ctx.file), ctx);
2445
2445
  }
2446
- if (filter2.value(ctx.file)) {
2446
+ if (filter3.value(ctx.file)) {
2447
2447
  return handleHotUpdate(ctx, options.value);
2448
2448
  }
2449
2449
  },
@@ -2527,7 +2527,7 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
2527
2527
  if (query.raw || query.url) {
2528
2528
  return;
2529
2529
  }
2530
- if (!filter2.value(filename) && !query.vue) {
2530
+ if (!filter3.value(filename) && !query.vue) {
2531
2531
  if (!query.vue && refTransformFilter.value(filename) && options.value.compiler.shouldTransformRef(code)) {
2532
2532
  const result = options.value.compiler.transformRef(code, {
2533
2533
  filename,
@@ -4647,6 +4647,60 @@ var import_picocolors = __toESM(require_picocolors());
4647
4647
  var import_plugin_vue3 = __toESM(require_plugin_vue3());
4648
4648
  import { vitePlugin as apimockPlugin } from "@forsakringskassan/apimock-express";
4649
4649
 
4650
+ // src/plugins/babel-plugin.ts
4651
+ import * as babel from "@babel/core";
4652
+ var filter = /\.(js|ts|vue)$/;
4653
+ function babelPlugin() {
4654
+ return {
4655
+ name: "fk:babel",
4656
+ enforce: "post",
4657
+ async transform(src, id) {
4658
+ const { pathname: filename } = new URL(id, "file://");
4659
+ if (!filter.test(filename)) {
4660
+ return null;
4661
+ }
4662
+ const transformed = await babel.transformAsync(src, {
4663
+ sourceMaps: true,
4664
+ comments: true,
4665
+ filename
4666
+ });
4667
+ if (!transformed) {
4668
+ return null;
4669
+ }
4670
+ const { code, map } = transformed;
4671
+ return {
4672
+ code: code ?? src,
4673
+ map: map ?? null
4674
+ };
4675
+ }
4676
+ };
4677
+ }
4678
+
4679
+ // src/plugins/custom-mapping-plugin.ts
4680
+ var folder = {
4681
+ es: "esm",
4682
+ cjs: "cjs"
4683
+ };
4684
+ function customMappingPlugin() {
4685
+ return {
4686
+ name: "fk:custom-mapping",
4687
+ renderStart(options) {
4688
+ const { format } = options;
4689
+ if (format !== "es" && format !== "cjs") {
4690
+ return;
4691
+ }
4692
+ const replacement = folder[format];
4693
+ options.dir = options.dir?.replace("[custom-format]", replacement);
4694
+ if (typeof options.entryFileNames === "string") {
4695
+ options.entryFileNames = options.entryFileNames.replace(
4696
+ "[custom-format]",
4697
+ replacement
4698
+ );
4699
+ }
4700
+ }
4701
+ };
4702
+ }
4703
+
4650
4704
  // src/plugins/index-html-plugin.ts
4651
4705
  import fs from "node:fs/promises";
4652
4706
  import path from "node:path";
@@ -4718,15 +4772,10 @@ function indexHtmlPlugin() {
4718
4772
  }
4719
4773
 
4720
4774
  // src/plugins/package-json-plugin.ts
4721
- import path2 from "node:path/posix";
4722
4775
  var mapping = {
4723
4776
  es: "module",
4724
4777
  cjs: "commonjs"
4725
4778
  };
4726
- var folder = {
4727
- es: "esm",
4728
- cjs: "cjs"
4729
- };
4730
4779
  function packageJsonPlugin() {
4731
4780
  return {
4732
4781
  name: "fk:package-json",
@@ -4740,7 +4789,7 @@ function packageJsonPlugin() {
4740
4789
  };
4741
4790
  this.emitFile({
4742
4791
  type: "asset",
4743
- fileName: path2.join("dist", folder[format], "package.json"),
4792
+ fileName: "package.json",
4744
4793
  source: JSON.stringify(pkg, null, 2)
4745
4794
  });
4746
4795
  }
@@ -4765,7 +4814,7 @@ function detectInternalDependencies(packages2, dependencies2) {
4765
4814
 
4766
4815
  // src/utils/detect-monorepo-packages.ts
4767
4816
  import fs3 from "fs";
4768
- import path4 from "node:path";
4817
+ import path3 from "node:path";
4769
4818
 
4770
4819
  // node_modules/glob/node_modules/minimatch/dist/esm/index.js
4771
4820
  var import_brace_expansion = __toESM(require_brace_expansion(), 1);
@@ -5438,11 +5487,11 @@ var qmarksTestNoExtDot = ([$0]) => {
5438
5487
  return (f) => f.length === len && f !== "." && f !== "..";
5439
5488
  };
5440
5489
  var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
5441
- var path3 = {
5490
+ var path2 = {
5442
5491
  win32: { sep: "\\" },
5443
5492
  posix: { sep: "/" }
5444
5493
  };
5445
- var sep = defaultPlatform === "win32" ? path3.win32.sep : path3.posix.sep;
5494
+ var sep = defaultPlatform === "win32" ? path2.win32.sep : path2.posix.sep;
5446
5495
  minimatch.sep = sep;
5447
5496
  var GLOBSTAR = Symbol("globstar **");
5448
5497
  minimatch.GLOBSTAR = GLOBSTAR;
@@ -5450,8 +5499,8 @@ var qmark2 = "[^/]";
5450
5499
  var star2 = qmark2 + "*?";
5451
5500
  var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
5452
5501
  var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
5453
- var filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
5454
- minimatch.filter = filter;
5502
+ var filter2 = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
5503
+ minimatch.filter = filter2;
5455
5504
  var ext = (a, b = {}) => Object.assign({}, a, b);
5456
5505
  var defaults = (def) => {
5457
5506
  if (!def || typeof def !== "object" || !Object.keys(def).length) {
@@ -8524,12 +8573,12 @@ var PathBase = class {
8524
8573
  /**
8525
8574
  * Get the Path object referenced by the string path, resolved from this Path
8526
8575
  */
8527
- resolve(path5) {
8528
- if (!path5) {
8576
+ resolve(path4) {
8577
+ if (!path4) {
8529
8578
  return this;
8530
8579
  }
8531
- const rootPath = this.getRootString(path5);
8532
- const dir = path5.substring(rootPath.length);
8580
+ const rootPath = this.getRootString(path4);
8581
+ const dir = path4.substring(rootPath.length);
8533
8582
  const dirParts = dir.split(this.splitSep);
8534
8583
  const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
8535
8584
  return result;
@@ -9281,8 +9330,8 @@ var PathWin32 = class _PathWin32 extends PathBase {
9281
9330
  /**
9282
9331
  * @internal
9283
9332
  */
9284
- getRootString(path5) {
9285
- return win32.parse(path5).root;
9333
+ getRootString(path4) {
9334
+ return win32.parse(path4).root;
9286
9335
  }
9287
9336
  /**
9288
9337
  * @internal
@@ -9328,8 +9377,8 @@ var PathPosix = class _PathPosix extends PathBase {
9328
9377
  /**
9329
9378
  * @internal
9330
9379
  */
9331
- getRootString(path5) {
9332
- return path5.startsWith("/") ? "/" : "";
9380
+ getRootString(path4) {
9381
+ return path4.startsWith("/") ? "/" : "";
9333
9382
  }
9334
9383
  /**
9335
9384
  * @internal
@@ -9418,11 +9467,11 @@ var PathScurryBase = class {
9418
9467
  /**
9419
9468
  * Get the depth of a provided path, string, or the cwd
9420
9469
  */
9421
- depth(path5 = this.cwd) {
9422
- if (typeof path5 === "string") {
9423
- path5 = this.cwd.resolve(path5);
9470
+ depth(path4 = this.cwd) {
9471
+ if (typeof path4 === "string") {
9472
+ path4 = this.cwd.resolve(path4);
9424
9473
  }
9425
- return path5.depth();
9474
+ return path4.depth();
9426
9475
  }
9427
9476
  /**
9428
9477
  * Return the cache of child entries. Exposed so subclasses can create
@@ -9648,9 +9697,9 @@ var PathScurryBase = class {
9648
9697
  opts = entry;
9649
9698
  entry = this.cwd;
9650
9699
  }
9651
- const { withFileTypes = true, follow = false, filter: filter2, walkFilter } = opts;
9700
+ const { withFileTypes = true, follow = false, filter: filter3, walkFilter } = opts;
9652
9701
  const results = [];
9653
- if (!filter2 || filter2(entry)) {
9702
+ if (!filter3 || filter3(entry)) {
9654
9703
  results.push(withFileTypes ? entry : entry.fullpath());
9655
9704
  }
9656
9705
  const dirs = /* @__PURE__ */ new Set();
@@ -9669,7 +9718,7 @@ var PathScurryBase = class {
9669
9718
  }
9670
9719
  };
9671
9720
  for (const e of entries) {
9672
- if (!filter2 || filter2(e)) {
9721
+ if (!filter3 || filter3(e)) {
9673
9722
  results.push(withFileTypes ? e : e.fullpath());
9674
9723
  }
9675
9724
  if (follow && e.isSymbolicLink()) {
@@ -9700,16 +9749,16 @@ var PathScurryBase = class {
9700
9749
  opts = entry;
9701
9750
  entry = this.cwd;
9702
9751
  }
9703
- const { withFileTypes = true, follow = false, filter: filter2, walkFilter } = opts;
9752
+ const { withFileTypes = true, follow = false, filter: filter3, walkFilter } = opts;
9704
9753
  const results = [];
9705
- if (!filter2 || filter2(entry)) {
9754
+ if (!filter3 || filter3(entry)) {
9706
9755
  results.push(withFileTypes ? entry : entry.fullpath());
9707
9756
  }
9708
9757
  const dirs = /* @__PURE__ */ new Set([entry]);
9709
9758
  for (const dir of dirs) {
9710
9759
  const entries = dir.readdirSync();
9711
9760
  for (const e of entries) {
9712
- if (!filter2 || filter2(e)) {
9761
+ if (!filter3 || filter3(e)) {
9713
9762
  results.push(withFileTypes ? e : e.fullpath());
9714
9763
  }
9715
9764
  let r = e;
@@ -9762,15 +9811,15 @@ var PathScurryBase = class {
9762
9811
  opts = entry;
9763
9812
  entry = this.cwd;
9764
9813
  }
9765
- const { withFileTypes = true, follow = false, filter: filter2, walkFilter } = opts;
9766
- if (!filter2 || filter2(entry)) {
9814
+ const { withFileTypes = true, follow = false, filter: filter3, walkFilter } = opts;
9815
+ if (!filter3 || filter3(entry)) {
9767
9816
  yield withFileTypes ? entry : entry.fullpath();
9768
9817
  }
9769
9818
  const dirs = /* @__PURE__ */ new Set([entry]);
9770
9819
  for (const dir of dirs) {
9771
9820
  const entries = dir.readdirSync();
9772
9821
  for (const e of entries) {
9773
- if (!filter2 || filter2(e)) {
9822
+ if (!filter3 || filter3(e)) {
9774
9823
  yield withFileTypes ? e : e.fullpath();
9775
9824
  }
9776
9825
  let r = e;
@@ -9793,9 +9842,9 @@ var PathScurryBase = class {
9793
9842
  opts = entry;
9794
9843
  entry = this.cwd;
9795
9844
  }
9796
- const { withFileTypes = true, follow = false, filter: filter2, walkFilter } = opts;
9845
+ const { withFileTypes = true, follow = false, filter: filter3, walkFilter } = opts;
9797
9846
  const results = new Minipass({ objectMode: true });
9798
- if (!filter2 || filter2(entry)) {
9847
+ if (!filter3 || filter3(entry)) {
9799
9848
  results.write(withFileTypes ? entry : entry.fullpath());
9800
9849
  }
9801
9850
  const dirs = /* @__PURE__ */ new Set();
@@ -9828,7 +9877,7 @@ var PathScurryBase = class {
9828
9877
  }
9829
9878
  }
9830
9879
  for (const e of entries) {
9831
- if (e && (!filter2 || filter2(e))) {
9880
+ if (e && (!filter3 || filter3(e))) {
9832
9881
  if (!results.write(withFileTypes ? e : e.fullpath())) {
9833
9882
  paused = true;
9834
9883
  }
@@ -9862,10 +9911,10 @@ var PathScurryBase = class {
9862
9911
  opts = entry;
9863
9912
  entry = this.cwd;
9864
9913
  }
9865
- const { withFileTypes = true, follow = false, filter: filter2, walkFilter } = opts;
9914
+ const { withFileTypes = true, follow = false, filter: filter3, walkFilter } = opts;
9866
9915
  const results = new Minipass({ objectMode: true });
9867
9916
  const dirs = /* @__PURE__ */ new Set();
9868
- if (!filter2 || filter2(entry)) {
9917
+ if (!filter3 || filter3(entry)) {
9869
9918
  results.write(withFileTypes ? entry : entry.fullpath());
9870
9919
  }
9871
9920
  const queue = [entry];
@@ -9883,7 +9932,7 @@ var PathScurryBase = class {
9883
9932
  dirs.add(dir);
9884
9933
  const entries = dir.readdirSync();
9885
9934
  for (const e of entries) {
9886
- if (!filter2 || filter2(e)) {
9935
+ if (!filter3 || filter3(e)) {
9887
9936
  if (!results.write(withFileTypes ? e : e.fullpath())) {
9888
9937
  paused = true;
9889
9938
  }
@@ -9909,9 +9958,9 @@ var PathScurryBase = class {
9909
9958
  process2();
9910
9959
  return results;
9911
9960
  }
9912
- chdir(path5 = this.cwd) {
9961
+ chdir(path4 = this.cwd) {
9913
9962
  const oldCwd = this.cwd;
9914
- this.cwd = typeof path5 === "string" ? this.cwd.resolve(path5) : path5;
9963
+ this.cwd = typeof path4 === "string" ? this.cwd.resolve(path4) : path4;
9915
9964
  this.cwd[setAsCwd](oldCwd);
9916
9965
  }
9917
9966
  };
@@ -10267,8 +10316,8 @@ var MatchRecord = class {
10267
10316
  }
10268
10317
  // match, absolute, ifdir
10269
10318
  entries() {
10270
- return [...this.store.entries()].map(([path5, n]) => [
10271
- path5,
10319
+ return [...this.store.entries()].map(([path4, n]) => [
10320
+ path4,
10272
10321
  !!(n & 2),
10273
10322
  !!(n & 1)
10274
10323
  ]);
@@ -10473,9 +10522,9 @@ var GlobUtil = class {
10473
10522
  signal;
10474
10523
  maxDepth;
10475
10524
  includeChildMatches;
10476
- constructor(patterns, path5, opts) {
10525
+ constructor(patterns, path4, opts) {
10477
10526
  this.patterns = patterns;
10478
- this.path = path5;
10527
+ this.path = path4;
10479
10528
  this.opts = opts;
10480
10529
  this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
10481
10530
  this.includeChildMatches = opts.includeChildMatches !== false;
@@ -10494,11 +10543,11 @@ var GlobUtil = class {
10494
10543
  });
10495
10544
  }
10496
10545
  }
10497
- #ignored(path5) {
10498
- return this.seen.has(path5) || !!this.#ignore?.ignored?.(path5);
10546
+ #ignored(path4) {
10547
+ return this.seen.has(path4) || !!this.#ignore?.ignored?.(path4);
10499
10548
  }
10500
- #childrenIgnored(path5) {
10501
- return !!this.#ignore?.childrenIgnored?.(path5);
10549
+ #childrenIgnored(path4) {
10550
+ return !!this.#ignore?.childrenIgnored?.(path4);
10502
10551
  }
10503
10552
  // backpressure mechanism
10504
10553
  pause() {
@@ -10713,8 +10762,8 @@ var GlobUtil = class {
10713
10762
  };
10714
10763
  var GlobWalker = class extends GlobUtil {
10715
10764
  matches = /* @__PURE__ */ new Set();
10716
- constructor(patterns, path5, opts) {
10717
- super(patterns, path5, opts);
10765
+ constructor(patterns, path4, opts) {
10766
+ super(patterns, path4, opts);
10718
10767
  }
10719
10768
  matchEmit(e) {
10720
10769
  this.matches.add(e);
@@ -10751,8 +10800,8 @@ var GlobWalker = class extends GlobUtil {
10751
10800
  };
10752
10801
  var GlobStream = class extends GlobUtil {
10753
10802
  results;
10754
- constructor(patterns, path5, opts) {
10755
- super(patterns, path5, opts);
10803
+ constructor(patterns, path4, opts) {
10804
+ super(patterns, path4, opts);
10756
10805
  this.results = new Minipass({
10757
10806
  signal: this.signal,
10758
10807
  objectMode: true
@@ -11057,7 +11106,7 @@ function detectMonorepoPackages(...pkgPaths) {
11057
11106
  if (!fs3.existsSync(pkgPath)) {
11058
11107
  continue;
11059
11108
  }
11060
- const rootDir = path4.dirname(pkgPath);
11109
+ const rootDir = path3.dirname(pkgPath);
11061
11110
  const { workspaces } = readJsonFile(pkgPath);
11062
11111
  if (!workspaces) {
11063
11112
  continue;
@@ -11066,7 +11115,7 @@ function detectMonorepoPackages(...pkgPaths) {
11066
11115
  return {
11067
11116
  name: readJsonFile(filename).name,
11068
11117
  pkgPath: filename,
11069
- srcPath: path4.resolve(path4.dirname(filename), "src")
11118
+ srcPath: path3.resolve(path3.dirname(filename), "src")
11070
11119
  };
11071
11120
  });
11072
11121
  }
@@ -11249,7 +11298,13 @@ var internalDependencies = detectInternalDependencies(
11249
11298
  packages,
11250
11299
  allDependencies
11251
11300
  );
11252
- var defaultPlugins = [indexHtmlPlugin(), packageJsonPlugin(), vuePlugin()];
11301
+ var defaultPlugins = [
11302
+ indexHtmlPlugin(),
11303
+ packageJsonPlugin(),
11304
+ vuePlugin(),
11305
+ customMappingPlugin(),
11306
+ babelPlugin()
11307
+ ];
11253
11308
  var defaultConfig = {
11254
11309
  fk: {},
11255
11310
  plugins: defaultPlugins,
@@ -11265,22 +11320,16 @@ var defaultConfig = {
11265
11320
  emptyOutDir: false,
11266
11321
  minify: false,
11267
11322
  sourcemap: true,
11268
- outDir: "",
11323
+ outDir: "dist/[custom-format]",
11269
11324
  lib: {
11270
11325
  entry: "src/index.ts",
11271
11326
  formats: ["es", "cjs"]
11272
11327
  },
11273
11328
  rollupOptions: {
11274
11329
  output: {
11275
- entryFileNames: `temp/index.[format].js`,
11330
+ entryFileNames: `index.[custom-format].js`,
11276
11331
  globals: {
11277
11332
  vue: "Vue"
11278
- },
11279
- assetFileNames(assetInfo) {
11280
- if (assetInfo.name === "style.css") {
11281
- return "dist/style.css";
11282
- }
11283
- return assetInfo.name ?? "";
11284
11333
  }
11285
11334
  },
11286
11335
  external: Array.from(external)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forsakringskassan/vite-lib-config",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Försäkringskassan toolchain to build libraries with Vite",
5
5
  "keywords": [
6
6
  "vite"