Skip to content

Commit

Permalink
feat: cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
lajbel committed Aug 12, 2024
1 parent f8ff9f7 commit ea9a2f6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
{
"name": "@kaplayjs/crew",
"description": "The home of the KAPLAY assets.",
"version": "1.0.1",
"version": "1.0.2",
"type": "module",
"main": "./dist/index.mjs",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
"*": {
"import": {
"default": "./dist/index.mjs",
"types": "./dist/index.d.ts"
},
"require": {
"default": "./dist/index.cjs",
"types": "./dist/index.d.ts"
}
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/kaplayjs/crew.git"
},
"files": [
"dist/",
"README.md"
],
"scripts": {
"build": "pnpm run tsc && node --experimental-strip-types scripts/build.ts",
"tsc": "tsc",
Expand Down
10 changes: 10 additions & 0 deletions scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,13 @@ buildSync({
".png": "dataurl",
},
});

buildSync({
format: "cjs",
entryPoints: ["src/index.ts"],
bundle: true,
outfile: "dist/index.cjs",
loader: {
".png": "dataurl",
},
});

0 comments on commit ea9a2f6

Please sign in to comment.