Output format for the generated JavaScript files.
Examplenew nodejs.NodejsFunction(this, 'my-handler', {
bundling: {
minify: true,
sourceMap: true,
sourceMapMode: nodejs.SourceMapMode.INLINE,
sourcesContent: false,
target: 'es2020',
loader: {
'.png': 'dataurl',
},
define: {
'process.env.API_KEY': JSON.stringify('xxx-xxxx-xxx'),
'process.env.PRODUCTION': JSON.stringify(true),
'process.env.NUMBER': JSON.stringify(123),
},
logLevel: nodejs.LogLevel.ERROR,
keepNames: true,
tsconfig: 'custom-tsconfig.json',
metafile: true,
banner: '/* comments */',
footer: '/* comments */',
charset: nodejs.Charset.UTF8,
format: nodejs.OutputFormat.ESM,
mainFields: ['module', 'main'],
inject: ['./my-shim.js', './other-shim.js'],
esbuildArgs: {
"--log-limit": "0",
"--splitting": true,
},
},
});
Members Name Description CJS CommonJS. ESM ECMAScript module. CJS
CommonJS.
ESMECMAScript module.
Requires a running environment that supports import
and export
syntax.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4