Skip to content

Commit a59dc60

Browse files
committed
Improved babel integration
Signed-off-by: Jaid <jaid.jsx@gmail.com>
1 parent 4e41eb2 commit a59dc60

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/index.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,18 @@ export default class {
157157

158158
configBase.plugins = [exportDefaultModulePath]
159159

160-
if (this.options.babel === true) {
161-
configBase.plugins = [jsdocBabelPath, ...configBase.plugins]
162-
} else if (isObject(this.options.babel)) {
163-
configBase.plugins = [jsdocBabelPath, ...configBase.plugins]
164-
configBase.babel = this.options.babel
160+
if (this.options.babel) {
161+
configBase.plugins.unshift(jsdocBabelPath)
162+
const babelConfig = {
163+
cwd: compiler.context,
164+
root: compiler.context,
165+
comments: true,
166+
env: {
167+
NODE_ENV: "development",
168+
},
169+
...(isObject(this.options.babel) ? this.options.babel : undefined),
170+
}
171+
configBase.babel = babelConfig
165172
}
166173

167174
if (!this.options.tsdOutputFile) {

0 commit comments

Comments
 (0)