Skip to content

Commit cacaf6a

Browse files
agriffisgregberge
authored andcommitted
fix: optional chaining syntax in dist module
Set the esbuild target so that optional chaining is transformed in the output module. Partial fix for #265
1 parent 2a59389 commit cacaf6a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

build/rollup.config.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ const bundle = (config) => ({
1414
external: (id) => !/^[./]/.test(id),
1515
})
1616

17+
const esbuildConfig = {
18+
target: 'es2015',
19+
}
20+
1721
export default [
1822
bundle({
19-
plugins: [esbuild()],
23+
plugins: [esbuild(esbuildConfig)],
2024
output: [
2125
{
2226
file: `${name}.js`,
@@ -31,7 +35,10 @@ export default [
3135
],
3236
}),
3337
bundle({
34-
plugins: [esbuild({ minify: true })],
38+
plugins: [esbuild({
39+
...esbuildConfig,
40+
minify: true,
41+
})],
3542
output: [
3643
{
3744
file: `${name}.min.mjs`,

0 commit comments

Comments
 (0)