Skip to content

Commit 505446d

Browse files
committed
move imports for the env files from /config/index.js directly into the webpack config.
Reasoning: thosen file imports are not configuration, so they don't belong inside of config/index.js
1 parent 11122cb commit 505446d

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

template/build/webpack.dev.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const devWebpackConfig = merge(baseWebpackConfig, {
3434
},
3535
plugins: [
3636
new webpack.DefinePlugin({
37-
'process.env': config.dev.env
37+
'process.env': require('../config/dev.env')
3838
}),
3939
new webpack.HotModuleReplacementPlugin(),
4040
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.

template/build/webpack.prod.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
1212

1313
const env = {{#if_or unit e2e}}process.env.NODE_ENV === 'testing'
1414
? require('../config/test.env')
15-
: {{/if_or}}config.build.env
15+
: {{/if_or}}require('../config/prod.env')
1616

1717
const webpackConfig = merge(baseWebpackConfig, {
1818
module: {

template/config/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const path = require('path')
66

77
module.exports = {
88
dev: {
9-
env: require('./dev.env'),
109
host: 'localhost', // can be overwritten by process.env.HOST
1110
port: 8080, // can be overwritten by process.env.HOST, if port is in use, a free one will be determined
1211

@@ -37,7 +36,7 @@ module.exports = {
3736
cssSourceMap: false
3837
},
3938
build: {
40-
env: require('./prod.env'),
39+
// Template for index.html
4140
index: path.resolve(__dirname, '../dist/index.html'),
4241

4342
// Paths

0 commit comments

Comments
 (0)