Skip to content

Commit f3f1be7

Browse files
renoirbegoist
authored andcommittedJul 22, 2019
fix: rootDir option not passed (#226)
* fix: rootDir not passed, preset-env debug #225 * Added DEBUG to make @babel/preset-env debug * tweaks * let's not make unnecessary change
1 parent 8f0aa1d commit f3f1be7

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed
 

‎src/cli.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ cli
5858
.example(bin => ` ${bin} --input.index src/foo.ts`)
5959
.action(async (input, options) => {
6060
const { Bundler } = await import('./')
61+
const rootDir = options.rootDir || '.'
6162
const bundler = new Bundler(
6263
{
6364
input: options.input || (input.length === 0 ? undefined : input),
@@ -91,7 +92,8 @@ cli
9192
? 'quiet'
9293
: undefined,
9394
stackTrace: options.stackTrace,
94-
configFile: options.config
95+
configFile: options.config,
96+
rootDir
9597
}
9698
)
9799
await bundler

‎src/index.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ export class Bundler {
522522
}
523523
})
524524

525-
let { format } = this.config.output
525+
let { format, target } = this.config.output
526526
if (Array.isArray(format)) {
527527
if (format.length === 0) {
528528
format = ['cjs']
@@ -536,8 +536,12 @@ export class Bundler {
536536

537537
for (const source of sources) {
538538
for (const format of formats) {
539+
let title = `Bundle ${source.files.join(', ')} in ${format} format`
540+
if (target) {
541+
title += ` for target ${target}`
542+
}
539543
tasks.push({
540-
title: `Bundle ${source.files.join(', ')} in ${format} format`,
544+
title,
541545
getConfig: async (context, task) => {
542546
const assets: Assets = new Map()
543547
this.bundles.add(assets)

0 commit comments

Comments
 (0)
Please sign in to comment.