esbuild-node-tsc
esbuild-node-tsc copied to clipboard
How transform to esm?
const esbuildPluginTsc = require('esbuild-plugin-tsc');
module.exports = {
outDir: './dist',
esbuild: {
minify: false,
format: "esm",
target: 'es2015',
plugins: [esbuildPluginTsc()]
},
assets: {
baseDir: 'src',
outDir: './dist',
filePatterns: ['**/*.json']
}
};
Seems like format is hardcoded to cjs and, since the spread operator comes first, format value cannot be overridden by an option:
https://github.com/a7ul/esbuild-node-tsc/blob/81f32d98b332d3d4b0e93516c3e200d650e17944/src/index.ts#L87-L94
ohhhh all right
could you raise a pr for this ?
ok, look like so easy
this is pr: https://github.com/a7ul/esbuild-node-tsc/pull/36
Not sure #36 alone solves the issue, please @1018715564 let us know
sorry, Due to my negligence, I forgot to add the format option to config this is pr: https://github.com/a7ul/esbuild-node-tsc/pull/38
I have tested it and can package the code in esm format normally
