Skip to content

Commit

Permalink
chore: update exports
Browse files Browse the repository at this point in the history
  • Loading branch information
imtaotao committed Jul 12, 2024
1 parent ec9e713 commit efab348
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 20 deletions.
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"semi": true,
"printWidth": 80,
"singleQuote": true,
"endOfLine": "crlf",
"trailingComma": "all"
}
24 changes: 14 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
{
"name": "danmu",
"version": "0.0.5",
"version": "0.0.6",
"description": "Flexible, cross-platform, powerful danmu library.",
"main": "./dist/danmu.cjs.js",
"unpkg": "./dist/danmu.umd.js",
"module": "./dist/danmu.esm-bundler.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/danmu.esm-bundler.js",
"require": "./dist/danmu.cjs.js",
"types": "./dist/index.d.ts"
"import": {
"types": "./dist/index.d.ts",
"node": "./dist/danmu.esm-bundler.mjs",
"default": "./dist/danmu.esm-bundler.js"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/danmu.cjs.js"
}
}
},
"files": [
"dist"
],
"files": ["dist"],
"scripts": {
"test": "jest",
"prepare": "husky",
"demo": "cd demo && pnpm run dev",
"demo:build": "rimraf ./demo/dist && cd demo && pnpm run build",
"build": "rimraf ./dist && rollup --config && rimraf ./dist/__tests__",
"build:watch": "rollup --config --watch",
"format": "prettier --write --parser typescript \"(src|dist|demo)/**/*.(js|ts?(x))\""
"format": "prettier --write --parser typescript \"(src|dist|demo)/**/*.((m)?js|ts?(x))\""
},
"lint-staged": {
"*.js": [
Expand Down Expand Up @@ -71,7 +75,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"aidly": "^1.4.4",
"hooks-plugin": "^1.2.3"
"aidly": "^1.4.6",
"hooks-plugin": "^1.2.5"
}
}
28 changes: 20 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import replace from "@rollup/plugin-replace";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "rollup-plugin-typescript2";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import pkg from "./package.json" assert { type: "json" };
import pkg from "./package.json" with { type: "json" };

const { dirname: __dirname } = import.meta;

Expand All @@ -22,10 +22,14 @@ const outputConfigs = {
format: "cjs",
file: path.resolve(__dirname, "dist/danmu.cjs.js"),
},
"esm-bundler": {
"esm-bundler-js": {
format: "es",
file: path.resolve(__dirname, "dist/danmu.esm-bundler.js"),
},
"esm-bundler-mjs": {
format: "es",
file: path.resolve(__dirname, "dist/danmu.esm-bundler.mjs"),
},
umd: {
format: "umd",
file: path.resolve(__dirname, "dist/danmu.umd.js"),
Expand Down

0 comments on commit efab348

Please sign in to comment.