Skip to content

Commit

Permalink
fix: bundle config target (#262)
Browse files Browse the repository at this point in the history
Co-authored-by: NONAME <0x142857@gmail.com>
  • Loading branch information
PabloSzx and egoist committed Jun 2, 2021
1 parent 1404fbb commit a436a17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export const bundle = async (
plugins: Plugin[],
loaders: {
[ext: string]: string
}
},
target: string | string[]
) => {
const transform = async (inputCode: string, id: string) => {
let code: string | undefined
Expand Down Expand Up @@ -41,6 +42,7 @@ export const bundle = async (
const result = await build({
entryPoints: [id],
format: 'esm',
target,
bundle: true,
write: false,
sourcemap: true,
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default (options: Options = {}): Plugin => {

async load(id) {
if (options.experimentalBundling) {
const bundled = await bundle(id, this, plugins, loaders)
const bundled = await bundle(id, this, plugins, loaders, target)
if (bundled.code) {
return {
code: bundled.code,
Expand Down

0 comments on commit a436a17

Please sign in to comment.