Rollup typescript warning #1590
Unanswered
brijesh231199
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have to use structuredClone function in my react component, build component during give below typescript warning from rollup. I have to use rollup/plugin-typescript latest version.
@rollup/plugin-typescript TS2304: Cannot find name 'structuredClone'.
how to fixt that warning?
Rollup.config.js file
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "@rollup/plugin-typescript";
import excludeDeps from "rollup-plugin-exclude-dependencies-from-bundle";
import { terser } from "rollup-plugin-terser";
import dts from "rollup-plugin-dts";
import url from "rollup-plugin-url";
const production = !process.env.ROLLUP_WATCH;
const PACKAGE_ROOT_PATH = process.cwd();
// rollup.config.js
/**
/
export default [
{
input:
${PACKAGE_ROOT_PATH}/src/index.ts
,output: [
{
dir: "dist",
format: "es",
sourcemap: false,
},
],
plugins: [
excludeDeps(),
resolve(),
commonjs(),
typescript({
tsconfig:
${PACKAGE_ROOT_PATH}/tsconfig.json
,}),
production && terser({ format: { comments: false } }),
url({
include: ["**/.woff", "**/*.woff2"],
// setting infinite limit will ensure that the files
// are always bundled with the code, not copied to /dist
limit: Infinity,
}),
],
},
{
input: "dist/types/index.d.ts",
output: [{ file: "dist/index.d.ts", format: "esm" }],
plugins: [dts()],
external: ['moment/min/locales','react-toastify/dist/ReactToastify.css']
},
];
tsconfig.json file
{
"compilerOptions": {
"esModuleInterop": true,
"strict": true,
"skipLibCheck": true,
"jsx": "react",
"lib": ["ESNext", "DOM"],
"module": "ESNext",
"declaration": true,
"sourceMap": false,
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"typeRoots": ["types"]
},
"exclude": ["node_modules", "/*.test.tsx", "/*.stories.tsx"]
}
Beta Was this translation helpful? Give feedback.
All reactions