mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +01:00
chore(build): disable tsup minification & add "use strict"; banner to CJS bundles (#7725)
* chore(build): disable tsup minification * chore(build): add `"use strict";` to CJS bundles
This commit is contained in:
@@ -5,9 +5,16 @@ export const tsup: Options = {
|
|||||||
dts: true,
|
dts: true,
|
||||||
entryPoints: ['src/index.ts'],
|
entryPoints: ['src/index.ts'],
|
||||||
format: ['esm', 'cjs'],
|
format: ['esm', 'cjs'],
|
||||||
minify: true,
|
minify: false,
|
||||||
keepNames: true,
|
keepNames: true,
|
||||||
skipNodeModulesBundle: true,
|
skipNodeModulesBundle: true,
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
target: 'es2021',
|
target: 'es2021',
|
||||||
|
esbuildOptions: (options, context) => {
|
||||||
|
if (context.format === 'cjs') {
|
||||||
|
options.banner = {
|
||||||
|
js: '"use strict";',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,10 +5,17 @@ export const tsup: Options = {
|
|||||||
dts: true,
|
dts: true,
|
||||||
entryPoints: ['src/index.ts'],
|
entryPoints: ['src/index.ts'],
|
||||||
format: ['esm', 'cjs'],
|
format: ['esm', 'cjs'],
|
||||||
minify: true,
|
minify: false,
|
||||||
// if false: causes Collection.constructor to be a minified value like: 'o'
|
// if false: causes Collection.constructor to be a minified value like: 'o'
|
||||||
keepNames: true,
|
keepNames: true,
|
||||||
skipNodeModulesBundle: true,
|
skipNodeModulesBundle: true,
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
target: 'es2021',
|
target: 'es2021',
|
||||||
|
esbuildOptions: (options, context) => {
|
||||||
|
if (context.format === 'cjs') {
|
||||||
|
options.banner = {
|
||||||
|
js: '"use strict";',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,9 +5,16 @@ export const tsup: Options = {
|
|||||||
dts: false,
|
dts: false,
|
||||||
entryPoints: ['src/index.ts'],
|
entryPoints: ['src/index.ts'],
|
||||||
format: ['esm', 'cjs'],
|
format: ['esm', 'cjs'],
|
||||||
minify: true,
|
minify: false,
|
||||||
keepNames: true,
|
keepNames: true,
|
||||||
skipNodeModulesBundle: true,
|
skipNodeModulesBundle: true,
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
target: 'es2021',
|
target: 'es2021',
|
||||||
|
esbuildOptions: (options, context) => {
|
||||||
|
if (context.format === 'cjs') {
|
||||||
|
options.banner = {
|
||||||
|
js: '"use strict";',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,9 +5,16 @@ export default defineConfig({
|
|||||||
dts: true,
|
dts: true,
|
||||||
entryPoints: ['src/index.ts'],
|
entryPoints: ['src/index.ts'],
|
||||||
format: ['esm', 'cjs'],
|
format: ['esm', 'cjs'],
|
||||||
minify: true,
|
minify: false,
|
||||||
keepNames: true,
|
keepNames: true,
|
||||||
skipNodeModulesBundle: true,
|
skipNodeModulesBundle: true,
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
target: 'es2021',
|
target: 'es2021',
|
||||||
|
esbuildOptions: (options, context) => {
|
||||||
|
if (context.format === 'cjs') {
|
||||||
|
options.banner = {
|
||||||
|
js: '"use strict";',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user