Skip to content

Commit

Permalink
fix: export getEnvConfig separately (#15)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: the import for getEnvConfig has to be changed to `import { getEnvConfig } from '@geprog/vite-plugin-env-config/getEnvConfig';`
  • Loading branch information
lukashass committed Feb 18, 2022
1 parent 6af855c commit 6e1a398
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default {
To access the environment variables use the built-in getter:

```ts
import { getEnvConfig } from '@geprog/vite-plugin-env-config';
import { getEnvConfig } from '@geprog/vite-plugin-env-config/getEnvConfig';

const backendURL = getEnvConfig('BACKEND_URL');
```
Expand Down
16 changes: 15 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./getEnvConfig": {
"import": "./dist/getEnvConfig.mjs",
"require": "./dist/getEnvConfig.js"
}
},
"typesVersions": {
"*": {
".": [
"./dist/index.d.ts"
],
"getEnvConfig": [
"./dist/getEnvConfig.d.ts"
]
}
},
"main": "./dist/index.js",
Expand All @@ -18,7 +32,7 @@
"/dist"
],
"scripts": {
"build": "tsup src/index.ts --dts --format cjs,esm",
"build": "tsup src/index.ts src/getEnvConfig.ts --dts --format cjs,esm",
"clean": "rm -rf dist/ node_modules/",
"lint": "eslint --max-warnings 0 .",
"lint:format": "prettier --check .",
Expand Down
5 changes: 1 addition & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
import { envConfig, EnvConfigOptions } from './envConfig';
import { EnvConfig, getEnvConfig } from './getEnvConfig';

export { EnvConfig, envConfig, EnvConfigOptions, getEnvConfig };
export { envConfig, EnvConfigOptions } from './envConfig';

0 comments on commit 6e1a398

Please sign in to comment.