Skip to content

Commit

Permalink
set env vars earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Jun 23, 2022
1 parent 5ba670e commit 4638cb2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/kit/src/vite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ function kit() {
};

if (command === 'build') {
process.env.VITE_SVELTEKIT_APP_VERSION = svelte_config.kit.version.name;
process.env.VITE_SVELTEKIT_APP_VERSION_FILE = `${svelte_config.kit.appDir}/version.json`;
process.env.VITE_SVELTEKIT_APP_VERSION_POLL_INTERVAL = `${svelte_config.kit.version.pollInterval}`;

manifest_data = sync.all(svelte_config).manifest_data;

/** @type {Record<string, string>} */
Expand Down Expand Up @@ -181,10 +185,6 @@ function kit() {

rimraf(paths.output_dir);
mkdirp(paths.output_dir);

process.env.VITE_SVELTEKIT_APP_VERSION = svelte_config.kit.version.name;
process.env.VITE_SVELTEKIT_APP_VERSION_FILE = `${svelte_config.kit.appDir}/version.json`;
process.env.VITE_SVELTEKIT_APP_VERSION_POLL_INTERVAL = `${svelte_config.kit.version.pollInterval}`;
},

async writeBundle(_options, bundle) {
Expand Down

0 comments on commit 4638cb2

Please sign in to comment.