Skip to content

Commit

Permalink
feat: custom .aegir.js config
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed May 16, 2016
1 parent bd5ad7e commit 26ffbbd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
16 changes: 14 additions & 2 deletions config/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,29 @@ const path = require('path')
const _ = require('lodash')

const pkg = require(path.resolve('package.json'))
let customConfig = {}
try {
require(path.resolve('.aegir.js'))
} catch (err) {
}
const babel = require('./babel')

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

let specific
let custom1 = {}
let custom2 = {}

if (pkg.aegir && pkg.aegir.webpack) {
specific = pkg.aegir.webpack
custom1 = pkg.aegir.webpack
}

if (customConfig && customConfig.webpack) {
custom2 = customConfig.webpack
}

const specific = _.defaultsDeep({}, custom1, custom2)

const shared = {
entry: [
require.resolve('babel-polyfill'),
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"semver": "^5.1.0",
"stream-http": "^2.3.0",
"transform-loader": "^0.2.3",
"webpack": "^2.1.0-beta.4"
"webpack": "^2.1.0-beta.7"
},
"repository": {
"type": "git",
Expand All @@ -83,4 +83,4 @@
"JGAntunes <j.goncalo.antunes@gmail.com>",
"dignifiedquire <dignifiedquire@gmail.com>"
]
}
}

0 comments on commit 26ffbbd

Please sign in to comment.