Skip to content

Commit 5d6aa82

Browse files
committed
use const
1 parent 2d90fc8 commit 5d6aa82

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ function createConfig(options, entry, format, writeMeta) {
187187
catch (e) {}
188188
}
189189

190+
const useTypescript = extname(entry)==='.ts';
191+
190192
let config = {
191193
inputOptions: {
192194
input: exportType ? resolve(__dirname, '../src/lib/__entry__.js') : entry,
@@ -203,8 +205,8 @@ function createConfig(options, entry, format, writeMeta) {
203205
inject: false,
204206
extract: !!writeMeta
205207
}),
206-
extname(entry)==='.ts' && typescript(),
207-
extname(entry)!=='.ts' && flow({ all: true }),
208+
useTypescript && typescript(),
209+
!useTypescript && flow({ all: true }),
208210
nodent({
209211
exclude: 'node_modules/**',
210212
noRuntime: true,
@@ -218,7 +220,7 @@ function createConfig(options, entry, format, writeMeta) {
218220
}
219221
}
220222
}),
221-
buble({
223+
!useTypescript && buble({
222224
exclude: 'node_modules/**',
223225
jsx: options.jsx || 'h',
224226
objectAssign: options.assign || 'Object.assign',

0 commit comments

Comments
 (0)