@sdeverywhere/plugin-vite 0.1.4 → 0.1.6

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
@@ -1,12 +1,32 @@
1
1
  # @sdeverywhere/plugin-vite
2
2
 
3
- This package provides a plugin that uses Vite and a given Vite configuration file
4
- to bundle an application or library as part of the SDEverywhere builder process
5
- (i.e., `sde bundle` or `sde dev`).
3
+ This package provides a plugin that uses Vite and a given Vite configuration file to bundle an application or library as part of the [SDEverywhere](https://github.com/climateinteractive/SDEverywhere) builder process (i.e., `sde bundle` or `sde dev`).
4
+
5
+ ## Quick Start
6
+
7
+ The best way to get started with SDEverywhere is to follow the [Quick Start](https://github.com/climateinteractive/SDEverywhere#quick-start) instructions.
8
+ If you follow those instructions, the `@sdeverywhere/plugin-vite` package will be added to your project automatically, in which case you can skip the next section and jump straight to the ["Usage"](#usage) section below.
9
+
10
+ ## Install
11
+
12
+ ```sh
13
+ # npm
14
+ npm install --save-dev @sdeverywhere/plugin-vite
15
+
16
+ # pnpm
17
+ pnpm add -D @sdeverywhere/plugin-vite
18
+
19
+ # yarn
20
+ yarn add -D @sdeverywhere/plugin-vite
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ _TODO: This section needs to be fleshed out. In the meantime, you can refer to the API documentation below for the options used to configure this plugin._
6
26
 
7
27
  ## Documentation
8
28
 
9
- TODO
29
+ API documentation (for plugin configuration options) is available in the [`docs`](./docs/index.md) directory.
10
30
 
11
31
  ## License
12
32
 
package/dist/index.cjs CHANGED
@@ -39,9 +39,8 @@ var VitePlugin = class {
39
39
  return this.buildIfNeeded(context, "post-build");
40
40
  }
41
41
  async buildIfNeeded(context, caller) {
42
- var _a, _b;
43
- const applyDev = ((_a = this.options.apply) == null ? void 0 : _a.development) || "post-build";
44
- const applyProd = ((_b = this.options.apply) == null ? void 0 : _b.production) || "post-build";
42
+ const applyDev = this.options.apply?.development || "post-build";
43
+ const applyProd = this.options.apply?.production || "post-build";
45
44
  const shouldBuild = context.config.mode === "development" && applyDev === caller || context.config.mode === "production" && applyProd === caller;
46
45
  if (shouldBuild) {
47
46
  context.log("info", `Building ${this.options.name}`);
@@ -50,13 +49,14 @@ var VitePlugin = class {
50
49
  return true;
51
50
  }
52
51
  async watch() {
53
- var _a, _b;
54
- if (((_a = this.options.apply) == null ? void 0 : _a.development) === "serve") {
52
+ if (this.options.apply?.development === "serve") {
55
53
  const server = await (0, import_vite.createServer)(this.options.config);
56
54
  await server.listen();
57
- } else if (((_b = this.options.apply) == null ? void 0 : _b.development) === "watch") {
55
+ } else if (this.options.apply?.development === "watch") {
58
56
  const config = {
59
57
  build: {
58
+ // Enable watch mode
59
+ // TODO: Only do this if not already set up in the given config?
60
60
  watch: {}
61
61
  },
62
62
  ...this.options.config
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/plugin.ts"],"sourcesContent":["// Copyright (c) 2022 Climate Interactive / New Venture Fund\n\nexport type { VitePluginOptions } from './options'\nexport { vitePlugin } from './plugin'\n","// Copyright (c) 2022 Climate Interactive / New Venture Fund\n\nimport type { InlineConfig, ViteDevServer } from 'vite'\nimport { build, createServer } from 'vite'\n\nimport type { BuildContext, Plugin } from '@sdeverywhere/build'\n\nimport type { VitePluginOptions } from './options'\n\nexport function vitePlugin(options: VitePluginOptions): Plugin {\n return new VitePlugin(options)\n}\n\nclass VitePlugin implements Plugin {\n constructor(private readonly options: VitePluginOptions) {}\n\n async postGenerate(context: BuildContext): Promise<boolean> {\n // Only build if the plugin is configured to run for 'post-generate'\n return this.buildIfNeeded(context, 'post-generate')\n }\n\n async postBuild(context: BuildContext): Promise<boolean> {\n // Only build if the plugin is configured to run for 'post-build'\n return this.buildIfNeeded(context, 'post-build')\n }\n\n private async buildIfNeeded(context: BuildContext, caller: 'post-generate' | 'post-build'): Promise<boolean> {\n // The apply values default to 'post-build' when left undefined\n const applyDev = this.options.apply?.development || 'post-build'\n const applyProd = this.options.apply?.production || 'post-build'\n\n // Run \"vite build\" only if configured for this mode\n const shouldBuild =\n (context.config.mode === 'development' && applyDev === caller) ||\n (context.config.mode === 'production' && applyProd === caller)\n if (shouldBuild) {\n context.log('info', `Building ${this.options.name}`)\n await build(this.options.config)\n // context.log('info', 'Done!')\n }\n return true\n }\n\n async watch(): Promise<void> {\n if (this.options.apply?.development === 'serve') {\n // Run \"vite dev\", which starts the app in a local server and\n // refreshes when source files are changed\n const server: ViteDevServer = await createServer(this.options.config)\n await server.listen()\n } else if (this.options.apply?.development === 'watch') {\n // Run \"vite build\" in watch mode so that it rebuilds when source\n // files are changed\n const config: InlineConfig = {\n build: {\n // Enable watch mode\n // TODO: Only do this if not already set up in the given config?\n watch: {}\n },\n ...this.options.config\n }\n await build(config)\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGA,kBAAoC;AAM7B,SAAS,WAAW,SAAoC;AAC7D,SAAO,IAAI,WAAW,OAAO;AAC/B;AAEA,IAAM,aAAN,MAAmC;AAAA,EACjC,YAA6B,SAA4B;AAA5B;AAAA,EAA6B;AAAA,EAE1D,MAAM,aAAa,SAAyC;AAE1D,WAAO,KAAK,cAAc,SAAS,eAAe;AAAA,EACpD;AAAA,EAEA,MAAM,UAAU,SAAyC;AAEvD,WAAO,KAAK,cAAc,SAAS,YAAY;AAAA,EACjD;AAAA,EAEA,MAAc,cAAc,SAAuB,QAA0D;AA1B/G;AA4BI,UAAM,aAAW,UAAK,QAAQ,UAAb,mBAAoB,gBAAe;AACpD,UAAM,cAAY,UAAK,QAAQ,UAAb,mBAAoB,eAAc;AAGpD,UAAM,cACH,QAAQ,OAAO,SAAS,iBAAiB,aAAa,UACtD,QAAQ,OAAO,SAAS,gBAAgB,cAAc;AACzD,QAAI,aAAa;AACf,cAAQ,IAAI,QAAQ,YAAY,KAAK,QAAQ,MAAM;AACnD,gBAAM,mBAAM,KAAK,QAAQ,MAAM;AAAA,IAEjC;AACA,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,QAAuB;AA3C/B;AA4CI,UAAI,UAAK,QAAQ,UAAb,mBAAoB,iBAAgB,SAAS;AAG/C,YAAM,SAAwB,UAAM,0BAAa,KAAK,QAAQ,MAAM;AACpE,YAAM,OAAO,OAAO;AAAA,IACtB,aAAW,UAAK,QAAQ,UAAb,mBAAoB,iBAAgB,SAAS;AAGtD,YAAM,SAAuB;AAAA,QAC3B,OAAO;AAAA,UAGL,OAAO,CAAC;AAAA,QACV;AAAA,QACA,GAAG,KAAK,QAAQ;AAAA,MAClB;AACA,gBAAM,mBAAM,MAAM;AAAA,IACpB;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/plugin.ts"],"sourcesContent":["// Copyright (c) 2022 Climate Interactive / New Venture Fund\n\nexport type { VitePluginOptions } from './options'\nexport { vitePlugin } from './plugin'\n","// Copyright (c) 2022 Climate Interactive / New Venture Fund\n\nimport type { InlineConfig, ViteDevServer } from 'vite'\nimport { build, createServer } from 'vite'\n\nimport type { BuildContext, Plugin } from '@sdeverywhere/build'\n\nimport type { VitePluginOptions } from './options'\n\nexport function vitePlugin(options: VitePluginOptions): Plugin {\n return new VitePlugin(options)\n}\n\nclass VitePlugin implements Plugin {\n constructor(private readonly options: VitePluginOptions) {}\n\n async postGenerate(context: BuildContext): Promise<boolean> {\n // Only build if the plugin is configured to run for 'post-generate'\n return this.buildIfNeeded(context, 'post-generate')\n }\n\n async postBuild(context: BuildContext): Promise<boolean> {\n // Only build if the plugin is configured to run for 'post-build'\n return this.buildIfNeeded(context, 'post-build')\n }\n\n private async buildIfNeeded(context: BuildContext, caller: 'post-generate' | 'post-build'): Promise<boolean> {\n // The apply values default to 'post-build' when left undefined\n const applyDev = this.options.apply?.development || 'post-build'\n const applyProd = this.options.apply?.production || 'post-build'\n\n // Run \"vite build\" only if configured for this mode\n const shouldBuild =\n (context.config.mode === 'development' && applyDev === caller) ||\n (context.config.mode === 'production' && applyProd === caller)\n if (shouldBuild) {\n context.log('info', `Building ${this.options.name}`)\n await build(this.options.config)\n // context.log('info', 'Done!')\n }\n return true\n }\n\n async watch(): Promise<void> {\n if (this.options.apply?.development === 'serve') {\n // Run \"vite dev\", which starts the app in a local server and\n // refreshes when source files are changed\n const server: ViteDevServer = await createServer(this.options.config)\n await server.listen()\n } else if (this.options.apply?.development === 'watch') {\n // Run \"vite build\" in watch mode so that it rebuilds when source\n // files are changed\n const config: InlineConfig = {\n build: {\n // Enable watch mode\n // TODO: Only do this if not already set up in the given config?\n watch: {}\n },\n ...this.options.config\n }\n await build(config)\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGA,kBAAoC;AAM7B,SAAS,WAAW,SAAoC;AAC7D,SAAO,IAAI,WAAW,OAAO;AAC/B;AAEA,IAAM,aAAN,MAAmC;AAAA,EACjC,YAA6B,SAA4B;AAA5B;AAAA,EAA6B;AAAA,EAE1D,MAAM,aAAa,SAAyC;AAE1D,WAAO,KAAK,cAAc,SAAS,eAAe;AAAA,EACpD;AAAA,EAEA,MAAM,UAAU,SAAyC;AAEvD,WAAO,KAAK,cAAc,SAAS,YAAY;AAAA,EACjD;AAAA,EAEA,MAAc,cAAc,SAAuB,QAA0D;AAE3G,UAAM,WAAW,KAAK,QAAQ,OAAO,eAAe;AACpD,UAAM,YAAY,KAAK,QAAQ,OAAO,cAAc;AAGpD,UAAM,cACH,QAAQ,OAAO,SAAS,iBAAiB,aAAa,UACtD,QAAQ,OAAO,SAAS,gBAAgB,cAAc;AACzD,QAAI,aAAa;AACf,cAAQ,IAAI,QAAQ,YAAY,KAAK,QAAQ,IAAI,EAAE;AACnD,gBAAM,mBAAM,KAAK,QAAQ,MAAM;AAAA,IAEjC;AACA,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,QAAuB;AAC3B,QAAI,KAAK,QAAQ,OAAO,gBAAgB,SAAS;AAG/C,YAAM,SAAwB,UAAM,0BAAa,KAAK,QAAQ,MAAM;AACpE,YAAM,OAAO,OAAO;AAAA,IACtB,WAAW,KAAK,QAAQ,OAAO,gBAAgB,SAAS;AAGtD,YAAM,SAAuB;AAAA,QAC3B,OAAO;AAAA;AAAA;AAAA,UAGL,OAAO,CAAC;AAAA,QACV;AAAA,QACA,GAAG,KAAK,QAAQ;AAAA,MAClB;AACA,gBAAM,mBAAM,MAAM;AAAA,IACpB;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,40 @@
1
+ import { InlineConfig } from 'vite';
2
+ import { Plugin } from '@sdeverywhere/build';
3
+
4
+ interface VitePluginOptions {
5
+ /** The name to include in log messages. */
6
+ name: string;
7
+ /** The Vite config to use. */
8
+ config: InlineConfig;
9
+ /** Specifies the behavior of the plugin for different `sde` build modes. */
10
+ apply?: {
11
+ /**
12
+ * The behavior of the plugin when sde is configured for development mode.
13
+ *
14
+ * If left undefined, defaults to 'post-build'.
15
+ *
16
+ * - `skip`: Don't run the plugin.
17
+ * - `post-generate`: Run `vite build` in the `postGenerate` phase.
18
+ * - `post-build`: Run `vite build` in the `postBuild` phase.
19
+ * - `watch`: Run `vite build` in the `watch` callback (rebuilds the library when
20
+ * changes are detected in source files); useful for libraries.
21
+ * - `serve`: Run `vite dev` (sets up local server and refreshes the app
22
+ * automatically when changes are detected); useful for applications.
23
+ */
24
+ development?: 'skip' | 'post-generate' | 'post-build' | 'watch' | 'serve';
25
+ /**
26
+ * The behavior of the plugin when sde is configured for production mode.
27
+ *
28
+ * If left undefined, defaults to 'post-build'.
29
+ *
30
+ * - `skip`: Don't run the plugin.
31
+ * - `post-generate`: Run `vite build` in the `postGenerate` phase.
32
+ * - `post-build`: Run `vite build` in the `postBuild` phase.
33
+ */
34
+ production?: 'skip' | 'post-generate' | 'post-build';
35
+ };
36
+ }
37
+
38
+ declare function vitePlugin(options: VitePluginOptions): Plugin;
39
+
40
+ export { VitePluginOptions, vitePlugin };
package/dist/index.d.ts CHANGED
@@ -13,20 +13,13 @@ interface VitePluginOptions {
13
13
  *
14
14
  * If left undefined, defaults to 'post-build'.
15
15
  *
16
- * ```
17
- * 'skip':
18
- * Don't run the plugin.
19
- * 'post-generate':
20
- * Run "vite build" in the `postGenerate` phase.
21
- * 'post-build':
22
- * Run "vite build" in the `postBuild` phase.
23
- * 'watch':
24
- * Run "vite build" in the `watch` callback (rebuilds the library when
16
+ * - `skip`: Don't run the plugin.
17
+ * - `post-generate`: Run `vite build` in the `postGenerate` phase.
18
+ * - `post-build`: Run `vite build` in the `postBuild` phase.
19
+ * - `watch`: Run `vite build` in the `watch` callback (rebuilds the library when
25
20
  * changes are detected in source files); useful for libraries.
26
- * 'serve':
27
- * Run "vite dev" (sets up local server and refreshes the app
21
+ * - `serve`: Run `vite dev` (sets up local server and refreshes the app
28
22
  * automatically when changes are detected); useful for applications.
29
- * ```
30
23
  */
31
24
  development?: 'skip' | 'post-generate' | 'post-build' | 'watch' | 'serve';
32
25
  /**
@@ -34,14 +27,9 @@ interface VitePluginOptions {
34
27
  *
35
28
  * If left undefined, defaults to 'post-build'.
36
29
  *
37
- * ```
38
- * 'skip':
39
- * Don't run the plugin.
40
- * 'post-generate':
41
- * Run "vite build" in the `postGenerate` phase.
42
- * 'post-build':
43
- * Run "vite build" in the `postBuild` phase.
44
- * ```
30
+ * - `skip`: Don't run the plugin.
31
+ * - `post-generate`: Run `vite build` in the `postGenerate` phase.
32
+ * - `post-build`: Run `vite build` in the `postBuild` phase.
45
33
  */
46
34
  production?: 'skip' | 'post-generate' | 'post-build';
47
35
  };
package/dist/index.js CHANGED
@@ -14,9 +14,8 @@ var VitePlugin = class {
14
14
  return this.buildIfNeeded(context, "post-build");
15
15
  }
16
16
  async buildIfNeeded(context, caller) {
17
- var _a, _b;
18
- const applyDev = ((_a = this.options.apply) == null ? void 0 : _a.development) || "post-build";
19
- const applyProd = ((_b = this.options.apply) == null ? void 0 : _b.production) || "post-build";
17
+ const applyDev = this.options.apply?.development || "post-build";
18
+ const applyProd = this.options.apply?.production || "post-build";
20
19
  const shouldBuild = context.config.mode === "development" && applyDev === caller || context.config.mode === "production" && applyProd === caller;
21
20
  if (shouldBuild) {
22
21
  context.log("info", `Building ${this.options.name}`);
@@ -25,13 +24,14 @@ var VitePlugin = class {
25
24
  return true;
26
25
  }
27
26
  async watch() {
28
- var _a, _b;
29
- if (((_a = this.options.apply) == null ? void 0 : _a.development) === "serve") {
27
+ if (this.options.apply?.development === "serve") {
30
28
  const server = await createServer(this.options.config);
31
29
  await server.listen();
32
- } else if (((_b = this.options.apply) == null ? void 0 : _b.development) === "watch") {
30
+ } else if (this.options.apply?.development === "watch") {
33
31
  const config = {
34
32
  build: {
33
+ // Enable watch mode
34
+ // TODO: Only do this if not already set up in the given config?
35
35
  watch: {}
36
36
  },
37
37
  ...this.options.config
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/plugin.ts"],"sourcesContent":["// Copyright (c) 2022 Climate Interactive / New Venture Fund\n\nimport type { InlineConfig, ViteDevServer } from 'vite'\nimport { build, createServer } from 'vite'\n\nimport type { BuildContext, Plugin } from '@sdeverywhere/build'\n\nimport type { VitePluginOptions } from './options'\n\nexport function vitePlugin(options: VitePluginOptions): Plugin {\n return new VitePlugin(options)\n}\n\nclass VitePlugin implements Plugin {\n constructor(private readonly options: VitePluginOptions) {}\n\n async postGenerate(context: BuildContext): Promise<boolean> {\n // Only build if the plugin is configured to run for 'post-generate'\n return this.buildIfNeeded(context, 'post-generate')\n }\n\n async postBuild(context: BuildContext): Promise<boolean> {\n // Only build if the plugin is configured to run for 'post-build'\n return this.buildIfNeeded(context, 'post-build')\n }\n\n private async buildIfNeeded(context: BuildContext, caller: 'post-generate' | 'post-build'): Promise<boolean> {\n // The apply values default to 'post-build' when left undefined\n const applyDev = this.options.apply?.development || 'post-build'\n const applyProd = this.options.apply?.production || 'post-build'\n\n // Run \"vite build\" only if configured for this mode\n const shouldBuild =\n (context.config.mode === 'development' && applyDev === caller) ||\n (context.config.mode === 'production' && applyProd === caller)\n if (shouldBuild) {\n context.log('info', `Building ${this.options.name}`)\n await build(this.options.config)\n // context.log('info', 'Done!')\n }\n return true\n }\n\n async watch(): Promise<void> {\n if (this.options.apply?.development === 'serve') {\n // Run \"vite dev\", which starts the app in a local server and\n // refreshes when source files are changed\n const server: ViteDevServer = await createServer(this.options.config)\n await server.listen()\n } else if (this.options.apply?.development === 'watch') {\n // Run \"vite build\" in watch mode so that it rebuilds when source\n // files are changed\n const config: InlineConfig = {\n build: {\n // Enable watch mode\n // TODO: Only do this if not already set up in the given config?\n watch: {}\n },\n ...this.options.config\n }\n await build(config)\n }\n }\n}\n"],"mappings":";AAGA,SAAS,OAAO,oBAAoB;AAM7B,SAAS,WAAW,SAAoC;AAC7D,SAAO,IAAI,WAAW,OAAO;AAC/B;AAEA,IAAM,aAAN,MAAmC;AAAA,EACjC,YAA6B,SAA4B;AAA5B;AAAA,EAA6B;AAAA,EAE1D,MAAM,aAAa,SAAyC;AAE1D,WAAO,KAAK,cAAc,SAAS,eAAe;AAAA,EACpD;AAAA,EAEA,MAAM,UAAU,SAAyC;AAEvD,WAAO,KAAK,cAAc,SAAS,YAAY;AAAA,EACjD;AAAA,EAEA,MAAc,cAAc,SAAuB,QAA0D;AA1B/G;AA4BI,UAAM,aAAW,UAAK,QAAQ,UAAb,mBAAoB,gBAAe;AACpD,UAAM,cAAY,UAAK,QAAQ,UAAb,mBAAoB,eAAc;AAGpD,UAAM,cACH,QAAQ,OAAO,SAAS,iBAAiB,aAAa,UACtD,QAAQ,OAAO,SAAS,gBAAgB,cAAc;AACzD,QAAI,aAAa;AACf,cAAQ,IAAI,QAAQ,YAAY,KAAK,QAAQ,MAAM;AACnD,YAAM,MAAM,KAAK,QAAQ,MAAM;AAAA,IAEjC;AACA,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,QAAuB;AA3C/B;AA4CI,UAAI,UAAK,QAAQ,UAAb,mBAAoB,iBAAgB,SAAS;AAG/C,YAAM,SAAwB,MAAM,aAAa,KAAK,QAAQ,MAAM;AACpE,YAAM,OAAO,OAAO;AAAA,IACtB,aAAW,UAAK,QAAQ,UAAb,mBAAoB,iBAAgB,SAAS;AAGtD,YAAM,SAAuB;AAAA,QAC3B,OAAO;AAAA,UAGL,OAAO,CAAC;AAAA,QACV;AAAA,QACA,GAAG,KAAK,QAAQ;AAAA,MAClB;AACA,YAAM,MAAM,MAAM;AAAA,IACpB;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/plugin.ts"],"sourcesContent":["// Copyright (c) 2022 Climate Interactive / New Venture Fund\n\nimport type { InlineConfig, ViteDevServer } from 'vite'\nimport { build, createServer } from 'vite'\n\nimport type { BuildContext, Plugin } from '@sdeverywhere/build'\n\nimport type { VitePluginOptions } from './options'\n\nexport function vitePlugin(options: VitePluginOptions): Plugin {\n return new VitePlugin(options)\n}\n\nclass VitePlugin implements Plugin {\n constructor(private readonly options: VitePluginOptions) {}\n\n async postGenerate(context: BuildContext): Promise<boolean> {\n // Only build if the plugin is configured to run for 'post-generate'\n return this.buildIfNeeded(context, 'post-generate')\n }\n\n async postBuild(context: BuildContext): Promise<boolean> {\n // Only build if the plugin is configured to run for 'post-build'\n return this.buildIfNeeded(context, 'post-build')\n }\n\n private async buildIfNeeded(context: BuildContext, caller: 'post-generate' | 'post-build'): Promise<boolean> {\n // The apply values default to 'post-build' when left undefined\n const applyDev = this.options.apply?.development || 'post-build'\n const applyProd = this.options.apply?.production || 'post-build'\n\n // Run \"vite build\" only if configured for this mode\n const shouldBuild =\n (context.config.mode === 'development' && applyDev === caller) ||\n (context.config.mode === 'production' && applyProd === caller)\n if (shouldBuild) {\n context.log('info', `Building ${this.options.name}`)\n await build(this.options.config)\n // context.log('info', 'Done!')\n }\n return true\n }\n\n async watch(): Promise<void> {\n if (this.options.apply?.development === 'serve') {\n // Run \"vite dev\", which starts the app in a local server and\n // refreshes when source files are changed\n const server: ViteDevServer = await createServer(this.options.config)\n await server.listen()\n } else if (this.options.apply?.development === 'watch') {\n // Run \"vite build\" in watch mode so that it rebuilds when source\n // files are changed\n const config: InlineConfig = {\n build: {\n // Enable watch mode\n // TODO: Only do this if not already set up in the given config?\n watch: {}\n },\n ...this.options.config\n }\n await build(config)\n }\n }\n}\n"],"mappings":";AAGA,SAAS,OAAO,oBAAoB;AAM7B,SAAS,WAAW,SAAoC;AAC7D,SAAO,IAAI,WAAW,OAAO;AAC/B;AAEA,IAAM,aAAN,MAAmC;AAAA,EACjC,YAA6B,SAA4B;AAA5B;AAAA,EAA6B;AAAA,EAE1D,MAAM,aAAa,SAAyC;AAE1D,WAAO,KAAK,cAAc,SAAS,eAAe;AAAA,EACpD;AAAA,EAEA,MAAM,UAAU,SAAyC;AAEvD,WAAO,KAAK,cAAc,SAAS,YAAY;AAAA,EACjD;AAAA,EAEA,MAAc,cAAc,SAAuB,QAA0D;AAE3G,UAAM,WAAW,KAAK,QAAQ,OAAO,eAAe;AACpD,UAAM,YAAY,KAAK,QAAQ,OAAO,cAAc;AAGpD,UAAM,cACH,QAAQ,OAAO,SAAS,iBAAiB,aAAa,UACtD,QAAQ,OAAO,SAAS,gBAAgB,cAAc;AACzD,QAAI,aAAa;AACf,cAAQ,IAAI,QAAQ,YAAY,KAAK,QAAQ,IAAI,EAAE;AACnD,YAAM,MAAM,KAAK,QAAQ,MAAM;AAAA,IAEjC;AACA,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,QAAuB;AAC3B,QAAI,KAAK,QAAQ,OAAO,gBAAgB,SAAS;AAG/C,YAAM,SAAwB,MAAM,aAAa,KAAK,QAAQ,MAAM;AACpE,YAAM,OAAO,OAAO;AAAA,IACtB,WAAW,KAAK,QAAQ,OAAO,gBAAgB,SAAS;AAGtD,YAAM,SAAuB;AAAA,QAC3B,OAAO;AAAA;AAAA;AAAA,UAGL,OAAO,CAAC;AAAA,QACV;AAAA,QACA,GAAG,KAAK,QAAQ;AAAA,MAClB;AACA,YAAM,MAAM,MAAM;AAAA,IACpB;AAAA,EACF;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdeverywhere/plugin-vite",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "files": [
5
5
  "dist/**"
6
6
  ],
@@ -16,12 +16,12 @@
16
16
  }
17
17
  },
18
18
  "peerDependencies": {
19
- "@sdeverywhere/build": "^0.2.0",
20
- "vite": "^3.0.0"
19
+ "@sdeverywhere/build": "^0.3.0",
20
+ "vite": "^3.0.0 || ^4.0.0"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@sdeverywhere/build": "*",
24
- "vite": "3.1.3"
24
+ "vite": "^4.4.9"
25
25
  },
26
26
  "author": "Climate Interactive",
27
27
  "license": "MIT",
@@ -45,6 +45,7 @@
45
45
  "test:ci": "echo No tests yet",
46
46
  "type-check": "tsc --noEmit -p tsconfig-build.json",
47
47
  "build": "tsup",
48
- "ci:build": "run-s clean lint prettier:check test:ci type-check build"
48
+ "docs": "../../scripts/gen-docs.js",
49
+ "ci:build": "run-s clean lint prettier:check test:ci type-check build docs"
49
50
  }
50
51
  }