Skip to content

Commit 7bc5a21

Browse files
author
Eduard Kyvenko
committed
fix($config): Another fix for the path config 😴
Messed up the module resolver and loader resolver
1 parent df0ae91 commit 7bc5a21

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

config/paths.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const path = require('path')
22
const isGlobal = require('installed-by-yarn-globally')
33

44
const appRoot = process.cwd()
5+
const ownModules = path.resolve(__dirname, '../node_modules')
56

67
const paths = {
78
appRoot,
@@ -10,13 +11,12 @@ const paths = {
1011
template: path.resolve('./src/index.html'),
1112
favicon: path.resolve('./src/favicon.ico'),
1213
elmPkg: path.resolve('elm-package.json'),
13-
ownModules: path.resolve(__dirname, '../node_modules'),
1414
scripts: path.resolve(__dirname, '../scripts'),
1515
elmMake: path.resolve(__dirname, '../node_modules/.bin/elm-make'),
16-
resolveLoaderModules: ['node_modules']
16+
resolveLoaderModules: [ ownModules ]
1717
}
1818

19-
// If installed globally by yarn, attemt to resolve loaders from the directory above.
19+
// If installed globally by yarn, attempt to resolve loaders from the directory above.
2020
if (isGlobal(__dirname)) {
2121
paths.resolveLoaderModules.push(path.resolve(__dirname, '../../'))
2222
}

config/webpack.config.prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ module.exports = {
3131
resolveLoader: {
3232

3333
// Look for loaders in own ./node_modules
34-
modules: [ paths.ownModules ],
34+
modules: paths.resolveLoaderModules,
3535
moduleExtensions: [ '-loader' ]
3636
},
3737

3838
resolve: {
39-
modules: paths.resolveLoaderModules,
39+
modules: [ 'node_modules' ],
4040
extensions: [ '.js', '.elm' ]
4141
},
4242

0 commit comments

Comments
 (0)