Skip to content

Commit

Permalink
bundler
Browse files Browse the repository at this point in the history
  • Loading branch information
catplvsplus committed Jun 1, 2024
1 parent 30d231d commit 2901d21
Show file tree
Hide file tree
Showing 12 changed files with 1,290 additions and 34 deletions.
1,212 changes: 1,196 additions & 16 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"discord.js": "^14.14.1",
"lerna": "^8.1.3",
"rimraf": "^5.0.7",
"tsup": "^8.0.2",
"typedoc": "^0.25.13",
"typescript": "^5.4.5"
},
Expand Down
15 changes: 10 additions & 5 deletions packages/giveaways/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "GPL-3.0",
"version": "1.0.0",
"main": "./dist/index.js",
"module": "./dist/esm.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"homepage": "https://thenorthsolution.github.io/djs-utils/modules/_thenorthsolution_djs_giveaways.html",
"repository": {
Expand All @@ -14,17 +14,22 @@
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/esm.mjs",
"require": "./dist/index.js"
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"files": [
"dist",
"LICENSE"
],
"scripts": {
"build": "npx tsc"
"build": "tsup"
},
"keywords": [
"giveaways",
Expand Down
1 change: 0 additions & 1 deletion packages/giveaways/src/esm.mts

This file was deleted.

3 changes: 3 additions & 0 deletions packages/giveaways/tsup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import createConfig from "../../tsup.config.mjs";

export default createConfig();
15 changes: 10 additions & 5 deletions packages/pagination/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "GPL-3.0",
"version": "1.0.0",
"main": "./dist/index.js",
"module": "./dist/esm.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"homepage": "https://thenorthsolution.github.io/djs-utils/modules/_thenorthsolution_djs_pagination.html",
"repository": {
Expand All @@ -14,9 +14,14 @@
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/esm.mjs",
"require": "./dist/index.js"
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"files": [
Expand All @@ -25,7 +30,7 @@
"README.md"
],
"scripts": {
"build": "npx tsc"
"build": "tsup"
},
"keywords": [
"djs",
Expand Down
1 change: 0 additions & 1 deletion packages/pagination/src/esm.mts

This file was deleted.

3 changes: 3 additions & 0 deletions packages/pagination/tsup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import createConfig from "../../tsup.config.mjs";

export default createConfig();
15 changes: 10 additions & 5 deletions packages/scam-links/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "GPL-3.0",
"version": "1.0.0",
"main": "./dist/index.js",
"module": "./dist/esm.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"homepage": "https://thenorthsolution.github.io/djs-utls/modules/_thenorthsolution_djs_scam_links.html",
"repository": {
Expand All @@ -14,17 +14,22 @@
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/esm.mjs",
"require": "./dist/index.js"
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"files": [
"dist",
"LICENSE"
],
"scripts": {
"build": "npx tsc"
"build": "tsup"
},
"dependencies": {
"@discordjs/collection": "^2.0.0",
Expand Down
1 change: 0 additions & 1 deletion packages/scam-links/src/esm.mts

This file was deleted.

3 changes: 3 additions & 0 deletions packages/scam-links/tsup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import createConfig from "../../tsup.config.mjs";

export default createConfig();
54 changes: 54 additions & 0 deletions tsup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// @ts-check
import { defineConfig } from 'tsup';

/**
*
* @param {Partial<import('tsup').Options>} options
*/
export default function createConfig({
entry = ['src/index.ts'],
external = [],
noExternal = [],
platform = 'node',
format = ['esm', 'cjs'],
target = 'es2022',
skipNodeModulesBundle = true,
clean = true,
shims = format.includes('cjs'),
cjsInterop = format.includes('cjs'),
minify = false,
terserOptions = {
mangle: false,
keep_classnames: true,
keep_fnames: true,
},
splitting = false,
keepNames = true,
dts = true,
sourcemap = true,
esbuildPlugins = [],
treeshake = false,
outDir = 'dist',
} = {}) {
return defineConfig({
entry,
external,
noExternal,
platform,
format,
skipNodeModulesBundle,
target,
clean,
shims,
cjsInterop,
minify,
terserOptions,
splitting,
keepNames,
dts,
sourcemap,
esbuildPlugins,
treeshake,
outDir,
});
}

0 comments on commit 2901d21

Please sign in to comment.