@abcnews/aunty 13.2.0 → 13.2.2
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/package.json +1 -1
- package/src/config/webpack.js +7 -1
package/package.json
CHANGED
package/src/config/webpack.js
CHANGED
|
@@ -147,6 +147,8 @@ function createWebpackConfig({ isModernJS } = {}) {
|
|
|
147
147
|
const { pkg, root, hasTS, type, webpack: projectWebpackConfig } = getProjectConfig();
|
|
148
148
|
const { entry, extractCSS, from, includedDependencies, staticDir, to, useCSSModules } = getBuildConfig();
|
|
149
149
|
const isProd = process.env.NODE_ENV === 'production';
|
|
150
|
+
const hasEnvFile = existsSync(join(root, '.env'));
|
|
151
|
+
const hasEnvExampleFile = existsSync(join(root, '.env.example'));
|
|
150
152
|
|
|
151
153
|
const config = merge(
|
|
152
154
|
{
|
|
@@ -232,7 +234,11 @@ function createWebpackConfig({ isModernJS } = {}) {
|
|
|
232
234
|
},
|
|
233
235
|
plugins: [
|
|
234
236
|
new EnvironmentPlugin(Object.keys(process.env)),
|
|
235
|
-
|
|
237
|
+
hasEnvFile || hasEnvExampleFile
|
|
238
|
+
? new Dotenv({
|
|
239
|
+
safe: hasEnvExampleFile
|
|
240
|
+
})
|
|
241
|
+
: null,
|
|
236
242
|
hasTS
|
|
237
243
|
? new ForkTsCheckerWebpackPlugin({
|
|
238
244
|
logger: { infrastructure: 'silent', issues: 'silent' },
|