File tree Expand file tree Collapse file tree 4 files changed +10
-10
lines changed
lib/install/config/webpack Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 1
- const environment = require ( 'webpacker' )
1
+ const { environment } = require ( 'webpacker' )
2
2
3
3
module . exports = environment . toWebpackConfig ( )
Original file line number Diff line number Diff line change 1
- const environment = require ( 'webpacker' )
1
+ const { environment } = require ( 'webpacker' )
2
2
3
3
module . exports = environment . toWebpackConfig ( )
Original file line number Diff line number Diff line change 1
- const environment = require ( 'webpacker' )
1
+ const { environment } = require ( 'webpacker' )
2
2
3
3
module . exports = environment . toWebpackConfig ( )
Original file line number Diff line number Diff line change 1
1
/* eslint global-require: 0 */
2
2
/* eslint import/no-dynamic-require: 0 */
3
3
4
+ const Environment = require ( './environment' )
4
5
const { existsSync } = require ( 'fs' )
5
6
6
- function createEnvironmentInstance ( ) {
7
- let path = `./environments/${ process . env . NODE_ENV } `
8
- if ( ! existsSync ( path ) ) {
9
- path = './environment'
10
- }
11
- const constructor = require ( path )
7
+ function createEnvironment ( ) {
8
+ const path = `./environments/${ process . env . NODE_ENV } `
9
+ const constructor = existsSync ( path ) ? require ( path ) : Environment
12
10
return new constructor ( )
13
11
}
14
12
15
- module . exports = createEnvironmentInstance ( )
13
+ const environment = createEnvironment ( )
14
+
15
+ module . exports = { environment, Environment }
You can’t perform that action at this time.
0 commit comments