@forsakringskassan/vite-lib-config 3.3.0 → 3.4.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.
package/README.md CHANGED
@@ -108,3 +108,20 @@ export function setup(options: SetupOptions): void {
108
108
  If the `setup` function is async (i.e. returns a `Promise`) it will be awaited before continuing.
109
109
 
110
110
  Create `src/vite-dev/app.vue` containing the root component you want to serve as a development environment.
111
+
112
+ ### Appending Plugins
113
+
114
+ If you need to use custom plugins in your library, remember to also include the default plugins, these will otherwise by overwritten.
115
+
116
+ #### `vite.config.ts`
117
+
118
+ ```ts
119
+ import {
120
+ defineConfig,
121
+ defaultPlugins,
122
+ } from "@forsakringskassan/vite-lib-config/vite";
123
+
124
+ export default defineConfig({
125
+ plugins: [...defaultPlugins, myFancyPlugin],
126
+ });
127
+ ```
@@ -4882,6 +4882,7 @@ var require_semver2 = __commonJS({
4882
4882
  var vite_config_exports = {};
4883
4883
  __export(vite_config_exports, {
4884
4884
  apimockPlugin: () => import_apimock_express2.vitePlugin,
4885
+ defaultPlugins: () => defaultPlugins,
4885
4886
  defineConfig: () => defineConfig,
4886
4887
  vuePlugin: () => vuePlugin
4887
4888
  });
@@ -4960,9 +4961,7 @@ function lookupFile(nameWithoutExtension) {
4960
4961
  return fileName;
4961
4962
  }
4962
4963
  }
4963
- throw new Error(
4964
- `Entry is missing. ${nameWithoutExtension}.{${extensions.join(",")}}`
4965
- );
4964
+ return `${nameWithoutExtension}.ts`;
4966
4965
  }
4967
4966
 
4968
4967
  // src/plugins/index-html-plugin.ts
@@ -11648,6 +11647,7 @@ function defineConfig(config) {
11648
11647
  // Annotate the CommonJS export names for ESM import in node:
11649
11648
  0 && (module.exports = {
11650
11649
  apimockPlugin,
11650
+ defaultPlugins,
11651
11651
  defineConfig,
11652
11652
  vuePlugin
11653
11653
  });
@@ -5,6 +5,11 @@ import { UserConfig as UserConfig_2 } from 'vite';
5
5
 
6
6
  export { apimockPlugin }
7
7
 
8
+ /**
9
+ * @public
10
+ */
11
+ export declare const defaultPlugins: Plugin_2<any>[];
12
+
8
13
  /**
9
14
  * @public
10
15
  */
@@ -4938,9 +4938,7 @@ function lookupFile(nameWithoutExtension) {
4938
4938
  return fileName;
4939
4939
  }
4940
4940
  }
4941
- throw new Error(
4942
- `Entry is missing. ${nameWithoutExtension}.{${extensions.join(",")}}`
4943
- );
4941
+ return `${nameWithoutExtension}.ts`;
4944
4942
  }
4945
4943
 
4946
4944
  // src/plugins/index-html-plugin.ts
@@ -11627,6 +11625,7 @@ function defineConfig(config) {
11627
11625
  }
11628
11626
  export {
11629
11627
  vitePlugin as apimockPlugin,
11628
+ defaultPlugins,
11630
11629
  defineConfig,
11631
11630
  vuePlugin2 as vuePlugin
11632
11631
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forsakringskassan/vite-lib-config",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "description": "Försäkringskassan toolchain to build libraries with Vite",
5
5
  "keywords": [
6
6
  "vite"