-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create template on vite build and inject script tag (#8)
Co-authored-by: Anbraten <anton@ju60.de> BREAKING CHANGE: `env-config.template.js` will be generated during the vite build, provide the needed variables in `vite.config.ts`
- Loading branch information
Showing
5 changed files
with
77 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { envConfig } from './envConfig'; | ||
import { envConfig, EnvConfigOptions } from './envConfig'; | ||
import { EnvConfig, getEnvConfig } from './getEnvConfig'; | ||
|
||
export { EnvConfig, envConfig, getEnvConfig }; | ||
export { EnvConfig, envConfig, EnvConfigOptions, getEnvConfig }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`createEnvConfigContent creates an env-config containing given variables and placeholders 1`] = `"(function(window){window.env=window.env||{};window.env['BACKEND_URL']='\${BACKEND_URL}';window.env['FOO']='\${FOO}';})(this);"`; | ||
|
||
exports[`createEnvConfigContent creates an env-config containing given variables and their values 1`] = `"(function(window){window.env=window.env||{};window.env['BACKEND_URL']='http://localhost:4000';window.env['FOO']='bar';window.env['NOT_SET']='';})(this);"`; | ||
|
||
exports[`createEnvConfigContent creates an env-config that does not set any variables 1`] = `"(function(window){window.env=window.env||{};})(this);"`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters