- 包声明 type:module 时 .js 产物被 Node 按 ESM 解析:Node 16/18 下 require 报 ERR_REQUIRE_ESM,Node 20+ 拿到 namespace 对象(success/version 等属性 undefined) - dist/metona-toast.cjs.js → .cjs,dist/react.cjs.js → .cjs - 主包 CJS footer 将 default 提升为 module.exports:require() 直接返回 MeToast(兼容 .default / .MeToast / .Met / .Toast / .VERSION 所有用法) - 版本 0.5.1(0.5.0 已发布带问题产物) - 真实消费者验证:CJS/ESM/React 子包四路加载全部正常
108 lines
2.8 KiB
JSON
108 lines
2.8 KiB
JSON
{
|
|
"name": "@metona-team/metona-toast",
|
|
"version": "0.5.1",
|
|
"description": "轻量、零依赖、精致美观的Toast通知库。TypeScript源码,开箱即用。",
|
|
"type": "module",
|
|
"main": "dist/metona-toast.cjs",
|
|
"module": "dist/metona-toast.esm.js",
|
|
"unpkg": "dist/metona-toast.min.js",
|
|
"jsdelivr": "dist/metona-toast.min.js",
|
|
"types": "dist/metona-toast.d.ts",
|
|
"exports": {
|
|
".": {
|
|
"import": "./dist/metona-toast.esm.js",
|
|
"require": "./dist/metona-toast.cjs",
|
|
"types": "./dist/metona-toast.d.ts"
|
|
},
|
|
"./react": {
|
|
"import": "./dist/react.js",
|
|
"require": "./dist/react.cjs",
|
|
"types": "./dist/react.d.ts"
|
|
}
|
|
},
|
|
"peerDependencies": {
|
|
"react": ">=17.0.0"
|
|
},
|
|
"peerDependenciesMeta": {
|
|
"react": {
|
|
"optional": true
|
|
}
|
|
},
|
|
"files": [
|
|
"dist/",
|
|
"src/",
|
|
"README.md",
|
|
"LICENSE"
|
|
],
|
|
"scripts": {
|
|
"build": "tsc --noEmit && rollup -c",
|
|
"dev": "rollup -c -w",
|
|
"test": "jest --coverage",
|
|
"test:watch": "jest --watch",
|
|
"lint": "eslint src/**/*.ts",
|
|
"lint:fix": "eslint src/**/*.ts --fix",
|
|
"format": "prettier --write src/**/*.ts tests/**/*.ts",
|
|
"typecheck": "tsc --noEmit",
|
|
"prepublishOnly": "npm run typecheck && npm run lint && npm test && npm run build",
|
|
"serve": "bash serve.sh"
|
|
},
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://git.metona.cn/MetonaTeam/MetonaToast.git"
|
|
},
|
|
"keywords": [
|
|
"toast",
|
|
"notification",
|
|
"alert",
|
|
"message",
|
|
"snackbar",
|
|
"ui",
|
|
"component",
|
|
"lightweight",
|
|
"zero-dependency"
|
|
],
|
|
"author": "thzxx",
|
|
"license": "MIT",
|
|
"bugs": {
|
|
"url": "https://git.metona.cn/MetonaTeam/MetonaToast/issues"
|
|
},
|
|
"homepage": "https://git.metona.cn/MetonaTeam/MetonaToast#readme",
|
|
"devDependencies": {
|
|
"@babel/core": "^7.22.0",
|
|
"@babel/plugin-transform-modules-commonjs": "^7.22.0",
|
|
"@babel/preset-env": "^7.22.0",
|
|
"@babel/preset-typescript": "^7.22.0",
|
|
"@rollup/plugin-commonjs": "^25.0.0",
|
|
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
"@rollup/plugin-terser": "^0.4.0",
|
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
"@types/jest": "^29.5.0",
|
|
"@types/react": "^18.3.31",
|
|
"@types/react-dom": "^18.3.7",
|
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
"@typescript-eslint/parser": "^8.0.0",
|
|
"babel-jest": "^29.5.0",
|
|
"eslint": "^8.40.0",
|
|
"jest": "^29.5.0",
|
|
"jest-environment-jsdom": "^29.5.0",
|
|
"prettier": "^2.8.0",
|
|
"react": "^18.3.1",
|
|
"react-dom": "^18.3.1",
|
|
"rollup": "^3.20.0",
|
|
"rollup-plugin-dts": "^5.3.0",
|
|
"rollup-plugin-livereload": "^2.0.5",
|
|
"rollup-plugin-serve": "^2.0.1",
|
|
"tslib": "^2.6.0",
|
|
"typescript": "^5.0.0"
|
|
},
|
|
"engines": {
|
|
"node": ">=16.0.0"
|
|
},
|
|
"browserslist": [
|
|
"> 1%",
|
|
"last 2 versions",
|
|
"not dead",
|
|
"not ie 11"
|
|
]
|
|
}
|