Skip to content
This repository was archived by the owner on Aug 15, 2023. It is now read-only.

Commit d122848

Browse files
committed
chore(shared): fix DOTENV_CONFIG_PATH resolution in webpack config
1 parent 2c88003 commit d122848

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

commitlint.config.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@ module.exports = {
77
'scope-enum': [
88
2,
99
'always',
10-
['workspace', 'guardoni', 'ycai', 'taboule', 'tktrex', 'yttrex'],
10+
[
11+
'workspace',
12+
'shared',
13+
'taboule',
14+
'backend',
15+
'guardoni',
16+
'ycai',
17+
'tktrex',
18+
],
1119
],
1220
'type-enum': [
1321
2,

packages/shared/src/webpack/config.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ const getConfig = <E extends t.Props>(
5656
process.env.NODE_ENV === 'production' ? 'production' : 'development';
5757

5858
const DOTENV_CONFIG_PATH =
59-
process.env.DOTENV_CONFIG_PATH ??
60-
path.resolve(opts.cwd, mode === 'production' ? '.env' : '.env.development');
61-
62-
// const tsConfigFile = path.resolve(opts.cwd, './tsconfig.json');
59+
process.env.DOTENV_CONFIG_PATH !== undefined
60+
? path.resolve(opts.cwd, process.env.DOTENV_CONFIG_PATH)
61+
: path.resolve(
62+
opts.cwd,
63+
mode === 'production' ? '.env' : '.env.development'
64+
);
6365

6466
webpackLogger.debug(`DOTENV_CONFIG_PATH %s`, DOTENV_CONFIG_PATH);
6567

0 commit comments

Comments
 (0)