Skip to content

Commit 26ffbbd

Browse files
feat: custom .aegir.js config
1 parent bd5ad7e commit 26ffbbd

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

config/webpack.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,29 @@ const path = require('path')
55
const _ = require('lodash')
66

77
const pkg = require(path.resolve('package.json'))
8+
let customConfig = {}
9+
try {
10+
require(path.resolve('.aegir.js'))
11+
} catch (err) {
12+
}
813
const babel = require('./babel')
914

1015
// e.g. peer-id -> PeerId
1116
const libraryName = _.upperFirst(_.camelCase(pkg.name))
1217

13-
let specific
18+
let custom1 = {}
19+
let custom2 = {}
1420

1521
if (pkg.aegir && pkg.aegir.webpack) {
16-
specific = pkg.aegir.webpack
22+
custom1 = pkg.aegir.webpack
23+
}
24+
25+
if (customConfig && customConfig.webpack) {
26+
custom2 = customConfig.webpack
1727
}
1828

29+
const specific = _.defaultsDeep({}, custom1, custom2)
30+
1931
const shared = {
2032
entry: [
2133
require.resolve('babel-polyfill'),

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"semver": "^5.1.0",
7070
"stream-http": "^2.3.0",
7171
"transform-loader": "^0.2.3",
72-
"webpack": "^2.1.0-beta.4"
72+
"webpack": "^2.1.0-beta.7"
7373
},
7474
"repository": {
7575
"type": "git",
@@ -83,4 +83,4 @@
8383
"JGAntunes <[email protected]>",
8484
"dignifiedquire <[email protected]>"
8585
]
86-
}
86+
}

0 commit comments

Comments
 (0)