Skip to content
This repository was archived by the owner on Mar 5, 2022. It is now read-only.

Commit 22eec19

Browse files
committed
fix: take default object from loaded webpack config
1 parent e64620f commit 22eec19

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

plugins/load-webpack/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ module.exports = (on, config) => {
1616
debug('got webpack config filename %s', webpackFilename)
1717
const resolved = path.resolve(webpackFilename)
1818
debug('resolved webpack at %s', webpackFilename)
19-
const webpackOptions = require(resolved)
19+
20+
let webpackOptions = require(resolved)
21+
debug('loaded webpack options: %o', webpackOptions)
22+
if (webpackOptions.default) {
23+
// we probably loaded TS file
24+
debug('loaded webpack options has .default - taking that as the config')
25+
webpackOptions = webpackOptions.default
26+
}
2027

2128
debug('webpack options: %o', webpackOptions)
2229

0 commit comments

Comments
 (0)