include esm build

This commit is contained in:
cupcakearmy 2022-05-31 15:31:36 +02:00
parent c48bf92f9c
commit b1ec1ec3ce
No known key found for this signature in database
GPG Key ID: 3235314B4D31232F
6 changed files with 757 additions and 872 deletions

View File

@ -1,9 +1,10 @@
![logo](https://github.com/cupcakearmy/canihazusername/raw/master/.github/logo.png) ![logo](https://github.com/cupcakearmy/canihazusername/raw/master/.github/logo.png)
![downloads badge](https://badgen.net/npm/dt/canihazusername)
![types badge](https://badgen.net/npm/types/canihazusername)
![version badge](https://badgen.net/npm/v/canihazusername) ![version badge](https://badgen.net/npm/v/canihazusername)
![downloads badge](https://badgen.net/npm/dt/canihazusername)
![dependency count](https://badgen.net/bundlephobia/dependency-count/canihazusername)
![minzip size badge](https://badgen.net/bundlephobia/minzip/canihazusername) ![minzip size badge](https://badgen.net/bundlephobia/minzip/canihazusername)
![types badge](https://badgen.net/npm/types/canihazusername)
Username generator. Fully typed, simple and customizable. **0 Dependencies** Username generator. Fully typed, simple and customizable. **0 Dependencies**

View File

@ -1,9 +1,22 @@
{ {
"name": "canihazusername", "name": "canihazusername",
"version": "2.2.3", "version": "2.3.0",
"description": "username generator. typed, simple and customizable", "description": "username generator. typed, simple and customizable",
"main": "./dist/index.js", "type": "module",
"types": "./dist/index.d.ts", "main": "./dist/cjs/index.js",
"types": "./dist/cjs/index.d.ts",
"exports": {
".": {
"import": {
"default": "./dist/esm/index.js",
"types": "./dist/esm/index.d.ts"
},
"require": {
"default": "./dist/cjs/index.js",
"types": "./dist/cjs/index.d.ts"
}
}
},
"files": [ "files": [
"dist" "dist"
], ],
@ -16,10 +29,12 @@
"scripts": { "scripts": {
"generate": "git submodule update && node ./generate/wordlist.js", "generate": "git submodule update && node ./generate/wordlist.js",
"dev": "tsc -w", "dev": "tsc -w",
"build": "tsc", "build:esm": "tsc -p ./tsconfig.esm.json",
"docs": "tsc && parcel build --target docs demo/index.html ", "build:cjs": "tsc -p ./tsconfig.cjs.json",
"build": "pnpm run build:esm && pnpm run build:cjs",
"docs": "pnpm run build && parcel build --target docs demo/index.html",
"docs:dev": "parcel --target docs demo/index.html", "docs:dev": "parcel --target docs demo/index.html",
"prepublishOnly": "rm -rf ./dist && tsc" "prepublishOnly": "rm -rf ./dist && pnpm run build"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -38,8 +53,8 @@
}, },
"homepage": "https://github.com/CupCakeArmy/canihazusername#readme", "homepage": "https://github.com/CupCakeArmy/canihazusername#readme",
"devDependencies": { "devDependencies": {
"bulma": "^0.9.3", "bulma": "^0.9.4",
"parcel": "^2.3.2", "parcel": "^2.6.0",
"typescript": "^4.6.2" "typescript": "^4.7.2"
} }
} }

File diff suppressed because it is too large Load Diff

7
tsconfig.cjs.json Normal file
View File

@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "./dist/cjs/"
}
}

7
tsconfig.esm.json Normal file
View File

@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "ES2020",
"outDir": "./dist/esm/"
}
}

View File

@ -26,7 +26,7 @@
/* Modules */ /* Modules */
"module": "commonjs" /* Specify what module code is generated. */, "module": "commonjs" /* Specify what module code is generated. */,
"rootDir": "./src" /* Specify the root folder within your source files. */, "rootDir": "./src" /* Specify the root folder within your source files. */,
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */