Skip to content

Commit

Permalink
Added option "babel"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaid committed Jan 28, 2019
1 parent 2513d8c commit 0d3507d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 7 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export default class {
jsdocHtmlConfig: {},
jsdocTsdConfig: {},
productionOnly: true,
babel: false,
...options,
}
}
Expand Down Expand Up @@ -124,6 +125,7 @@ export default class {
"tsd-jsdoc/dist",
"better-docs",
"jsdoc-export-default-interop/dist/index.js",
"jsdoc-babel/lib/index.js",
].map(async file => {
const possiblePaths = [
path.resolve(compiler.context, "node_modules", file),
Expand All @@ -138,10 +140,14 @@ export default class {
return foundFile
})

const [jsdocPath, tsdModulePath, htmlModulePath, exportDefaultModulePath] = await Promise.all(findModulesJobs)
const [jsdocPath, tsdModulePath, htmlModulePath, exportDefaultModulePath, jsdocBabelPath] = await Promise.all(findModulesJobs)

configBase.plugins = [exportDefaultModulePath]

if (this.options.babel) {
configBase.plugins.push(jsdocBabelPath)
}

if (!this.options.tsdOutputFile) {
const tsdFileName = path.basename(compilation.chunks[0].files[0], ".js")
this.options.autoTsdOutputFile = path.join(tempDir, `${tsdFileName}.d.ts`)
Expand Down
1 change: 0 additions & 1 deletion test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import path from "path"

import webpack from "webpack"
import pify from "pify"
import loadJsonFile from "load-json-file"
import CleanWebpackPlugin from "clean-webpack-plugin"
import PublishimoWebpackPlugin from "publishimo-webpack-plugin"

Expand Down
4 changes: 0 additions & 4 deletions webpack.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ import webpackConfigJaid from "webpack-config-jaid"

export default webpackConfigJaid({
type: "libClass",
include: [
"license.*",
"readme.md",
],
publishimo: {
publishimoOptions: {
fetchGithub: true,
Expand Down

0 comments on commit 0d3507d

Please sign in to comment.