我有mui材料的定制包装。它以前工作得很好,但现在它给了我以下错误:
我试过很多强行安装的方法,但都没有成功
我已经尝试过了——传统的同行deps标志也是真的,但仍然没有成功。
有人能查一下吗?
这是我的package.json文件
{
"name": "@genre/g2common-theme",
"version": "1.1.5",
"description": "TODO: Give a short introduction of your project. Let this section explain the objectives or the motivation behind this project.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"clean": "rimraf dist",
"rollup": "npm run clean && rollup -c --bundleConfigAsCjs",
"build": "npm run clean && rollup -c",
"release": "rollup -c",
"compile": "npm run clean && tsc",
"test": "echo \"Err: no test specified\" && exit 1",
"refreshVSToken": "vsts-npm-auth -config \"./.npmrc\" -TargetConfig \"$HOME/vs.npmrc\"",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"repository": {
"type": "git"
},
"keywords": [],
"author": "Syed Saad Shah",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.22.17",
"@babel/preset-env": "^7.22.15",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^5.0.2",
"@rollup/plugin-typescript": "^11.0.0",
"@storybook/addon-essentials": "^7.4.0",
"@storybook/addon-interactions": "^7.4.0",
"@storybook/addon-links": "^7.4.0",
"@storybook/addon-onboarding": "^1.0.8",
"@storybook/blocks": "^7.4.0",
"@storybook/react": "^7.4.0",
"@storybook/react-vite": "^7.4.0",
"@storybook/testing-library": "^0.2.0",
"@types/jest": "^29.2.6",
"@types/react": "^18.0.27",
"@types/styled-components": "^5.1.26",
"dotenv": "^16.0.3",
"jest": "^29.4.0",
"postcss": "^8.4.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rimraf": "^4.1.2",
"rollup": "^3.10.1",
"rollup-plugin-dotenv": "^0.4.1",
"rollup-plugin-dts": "^5.3.1",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",
"storybook": "^7.4.0",
"tslib": "^2.4.1",
"typescript": "^4.9.4"
},
"peerDependencies": {
"react": ">=17.0.0",
"react-dom": ">=17.0.0",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"styled-components": "^5.3.6"
},
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/material": "^5.14.7",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-image": "^3.0.2",
"@rollup/plugin-terser": "^0.4.3",
"styled-components": "^5.3.6"
}
}
这是我的汇总配置文件
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "@rollup/plugin-typescript";
import dts from "rollup-plugin-dts";
// To handle css files
import postcss from "rollup-plugin-postcss";
import terser from '@rollup/plugin-terser';
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
import image from '@rollup/plugin-image';
const packageJson = require("./package.json");
export default [
{
input: "src/index.ts",
output: [
{
file: packageJson.main,
format: "cjs",
sourcemap: true,
exports: "named",
},
{
file: packageJson.module,
format: "esm",
sourcemap: true,
exports: "named",
},
],
plugins: [
peerDepsExternal(),
resolve(),
commonjs(),
typescript({
tsconfig: "./tsconfig.json",
exclude: ["**/__stories__", "**/*.stories.tsx"],
}),
postcss(),
terser(),
image(),
],
external: [
...Object.keys(packageJson.dependencies || {}),
...Object.keys(packageJson.peerDependencies || {}),
"react",
"react-dom",
],
},
{
input: "dist/esm/dist/types/index.d.ts",
output: [{ file: "dist/index.d.ts", format: "esm" }],
plugins: [dts.default()],
external: [/\.css$/],
},
];