mirror of https://github.com/embarklabs/embark.git
paths more DRY
This commit is contained in:
parent
f1edc28f6d
commit
421927d815
|
@ -28,8 +28,11 @@ const embarkPath = process.env.EMBARK_PATH;
|
|||
|
||||
const embarkAliases = require(path.join(dappPath, '.embark/embark-aliases.json'));
|
||||
const embarkAssets = require(path.join(dappPath, '.embark/embark-assets.json'));
|
||||
const embarkNodeModules = path.join(embarkPath, 'node_modules');
|
||||
const embarkJson = require(path.join(dappPath, 'embark.json'));
|
||||
|
||||
const buildDir = path.join(dappPath, embarkJson.buildDir);
|
||||
|
||||
// it's important to `embark reset` if a pkg version is specified in
|
||||
// embark.json and changed/removed later, otherwise pkg resolution may behave
|
||||
// unexpectedly, e.g. a different version may get used owing to lexographical
|
||||
|
@ -119,7 +122,7 @@ const base = {
|
|||
// see: https://github.com/webpack/webpack/issues/6522#issuecomment-371120689
|
||||
globalObject: 'typeof self !== \'undefined\' ? self : this',
|
||||
libraryTarget: 'umd',
|
||||
path: path.join(dappPath, embarkJson.buildDir)
|
||||
path: buildDir
|
||||
},
|
||||
plugins: [new HardSourceWebpackPlugin()],
|
||||
// profiling and generating verbose stats increases build time; if stats
|
||||
|
@ -133,13 +136,13 @@ const base = {
|
|||
modules: [
|
||||
...versions,
|
||||
'node_modules',
|
||||
path.join(embarkPath, 'node_modules')
|
||||
embarkNodeModules
|
||||
]
|
||||
},
|
||||
resolveLoader: {
|
||||
modules: [
|
||||
'node_modules',
|
||||
path.join(embarkPath, 'node_modules')
|
||||
embarkNodeModules
|
||||
]
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue