mirror of
https://github.com/sern-handler/handler
synced 2026-06-06 01:16:55 +00:00
build: speed up build
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
".": {
|
||||
"import": "./dist/esm/index.mjs",
|
||||
"require": "./dist/cjs/index.cjs",
|
||||
"types": "dist/index.d.ts"
|
||||
"types": "./dist/index.d.ts"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
@@ -18,8 +18,8 @@
|
||||
"clean-modules": "rimraf node_modules/ && npm install",
|
||||
"lint": "eslint src/**/*.ts",
|
||||
"format": "eslint src/**/*.ts --fix",
|
||||
"build:dev": "tsup && tsup --dts-only --outDir dist",
|
||||
"build:prod": "tsup --minify && tsup --dts-only --outDir dist",
|
||||
"build:dev": "tsup --metafile",
|
||||
"build:prod": "tsup --minify",
|
||||
"publish": "npm run build:prod",
|
||||
"pretty": "prettier --write ."
|
||||
},
|
||||
|
||||
@@ -12,9 +12,8 @@
|
||||
"preserveSymlinks": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"types": ["@types/node"],
|
||||
"isolatedModules": true
|
||||
},
|
||||
"exclude": ["node_modules", "dist"],
|
||||
"include": ["src"]
|
||||
"include": ["src", "**/*.d.ts"]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
{
|
||||
"extends": "./tsconfig-esm.json"
|
||||
}
|
||||
|
||||
@@ -12,11 +12,12 @@ const shared = {
|
||||
correctVarValueBeforeDeclaration: true, //need this to treeshake esm discord.js empty import
|
||||
annotations: true,
|
||||
},
|
||||
dts: false
|
||||
};
|
||||
export default defineConfig([
|
||||
{
|
||||
format: 'esm',
|
||||
target: 'node16',
|
||||
target: 'node18',
|
||||
tsconfig: './tsconfig-esm.json',
|
||||
outDir: './dist/esm',
|
||||
splitting: true,
|
||||
@@ -37,7 +38,7 @@ export default defineConfig([
|
||||
format: 'cjs',
|
||||
esbuildPlugins: [ifdefPlugin({ variables: { MODE: 'cjs' }, verbose: true })],
|
||||
splitting: false,
|
||||
target: 'node16',
|
||||
target: 'node18',
|
||||
tsconfig: './tsconfig-cjs.json',
|
||||
outDir: './dist/cjs',
|
||||
outExtension() {
|
||||
@@ -50,10 +51,12 @@ export default defineConfig([
|
||||
await writeFile('./dist/cjs/package.json', JSON.stringify({ type: 'commonjs' }));
|
||||
},
|
||||
...shared,
|
||||
},
|
||||
// {
|
||||
// dts: true,
|
||||
// entry: ['src/presets/*.ts' ]
|
||||
//
|
||||
// }
|
||||
},
|
||||
{
|
||||
dts: {
|
||||
only: true
|
||||
},
|
||||
entry: ['src/index.ts'],
|
||||
outDir: 'dist'
|
||||
}
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user