You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import * as esbuild from 'esbuild'
const result = await esbuild.build({
entryPoints: ['app.js'],
bundle: true,
outfile: './result_esbuild.js',
format: 'esm',
target: ['es2015'],
})
The following example code represents the new features introduced in es8:
const matchObj = '---756---'.match(/(?<digits>[0-9]+)/)
console.log('matchObj', matchObj)
const re = /./.test('\n');
console.log(re)
const er = /^\p{White_Space}+$/u.test('\n \t')
console.log(er)
const es = 'Xabc def'.match(/(?<=X)[a-z]+/g)
console.log(es)
Build the following:
var matchObj = "---756---".match(new RegExp("(?<digits>[0-9]+)"));
console.log("matchObj", matchObj);
var re = /./.test("\n");
console.log(re);
var er = new RegExp("^\\p{White_Space}+$", "u").test("\n ");
console.log(er);
var es = "Xabc def".match(new RegExp("(?<=X)[a-z]+", "g"));
console.log(es);
I found the explanation of the above conversion in another issue, it seems that esbuild thought that the shim library would handle the above case, then I imported core-js globally and found that it only handles the RegExp named capture groups case. Others still fail in older versions of chrome?
I think if there are syntax features that can't be converted, the shim library can't handle them, and they should be handled like biginit, eg:
supported: {
'bigint': false,
},
The build should throw an error.
The text was updated successfully, but these errors were encountered:
This is by design. If your shim isn't working then that's a problem with the shim, not with esbuild. There is no one shim that esbuild supports so "the shim library can't handle them" isn't something that esbuild knows. You should either get your shim fixed or use a different shim.
The rebuild configuration is as follows:
The following example code represents the new features introduced in es8:
Build the following:
I found the explanation of the above conversion in another issue, it seems that esbuild thought that the shim library would handle the above case, then I imported core-js globally and found that it only handles the RegExp named capture groups case. Others still fail in older versions of chrome?
I think if there are syntax features that can't be converted, the shim library can't handle them, and they should be handled like biginit, eg:
supported: {
'bigint': false,
},
The build should throw an error.
The text was updated successfully, but these errors were encountered: