Skip to content

Commit

Permalink
Output more bundle format
Browse files Browse the repository at this point in the history
  • Loading branch information
graphemecluster committed Oct 7, 2024
1 parent ba711df commit 838d684
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 19 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
*.log
yarn.lock

/index.js
/index.js.map
/index.d.ts

/dist
/docs

/prepare/data.csv
Expand Down
20 changes: 13 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@
"version": "0.15.1",
"description": "A JavaScript library for the Qieyun phonological system",
"type": "module",
"main": "index.js",
"types": "index.d.ts",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"browser": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.cjs",
"import": "./dist/index.mjs",
"browser": "./dist/index.js"
}
},
"scripts": {
"build": "run-p build:*",
"build:rollup": "rollup -c",
Expand Down Expand Up @@ -79,11 +89,7 @@
"typescript-eslint": "^8.3.0"
},
"files": [
"index.js",
"index.js.map",
"index.d.ts",
"LICENSE",
"README.md"
"dist"
],
"ava": {
"failFast": true,
Expand Down
30 changes: 22 additions & 8 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,28 @@ import typescript from '@rollup/plugin-typescript';
/** @type { import("rollup").RollupOptions[] } */
export default [
{
input: 'src/index.ts',
output: {
file: 'index.js',
format: 'umd',
sourcemap: true,
name: 'TshetUinh',
exports: 'named',
},
input: './src/index.ts',
output: [
{
file: './dist/index.js',
format: 'umd',
name: 'TshetUinh',
exports: 'named',
sourcemap: true,
},
{
file: './dist/index.cjs',
format: 'cjs',
exports: 'named',
sourcemap: true,
},
{
file: './dist/index.mjs',
format: 'es',
exports: 'named',
sourcemap: true,
},
],
plugins: [
typescript({
// NOTE Apparently needed with `"incremental": true` in tsconfig
Expand Down

0 comments on commit 838d684

Please sign in to comment.