Update and replace old plugins
This commit is contained in:
parent
c66c8de825
commit
c561318434
|
@ -31,15 +31,13 @@
|
||||||
"@rollup/plugin-commonjs": "^17.1.0",
|
"@rollup/plugin-commonjs": "^17.1.0",
|
||||||
"@rollup/plugin-inject": "^5.0.5",
|
"@rollup/plugin-inject": "^5.0.5",
|
||||||
"@rollup/plugin-json": "^4.1.0",
|
"@rollup/plugin-json": "^4.1.0",
|
||||||
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||||
"@rollup/plugin-typescript": "8.3.0",
|
"@rollup/plugin-typescript": "8.3.0",
|
||||||
"doctrine": "^3.0.0",
|
"doctrine": "^3.0.0",
|
||||||
"jest": "29.7.0",
|
"jest": "29.7.0",
|
||||||
"marked": "^4.0.10",
|
"marked": "^4.0.10",
|
||||||
"rollup": "^2.36.2",
|
"rollup": "^2.36.2",
|
||||||
"rollup-plugin-inject-process-env": "^1.3.1",
|
"rollup-plugin-polyfill-node": "^0.13.0",
|
||||||
"rollup-plugin-node-builtins": "^2.1.2",
|
|
||||||
"rollup-plugin-node-globals": "^1.4.0",
|
|
||||||
"rollup-plugin-node-resolve": "^5.2.0",
|
|
||||||
"rollup-plugin-terser": "^7.0.2",
|
"rollup-plugin-terser": "^7.0.2",
|
||||||
"ts-jest": "29.1.1",
|
"ts-jest": "29.1.1",
|
||||||
"typescript": "5.7.2"
|
"typescript": "5.7.2"
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
import commonjs from "@rollup/plugin-commonjs"
|
import commonjs from "@rollup/plugin-commonjs"
|
||||||
import resolve from "rollup-plugin-node-resolve"
|
import resolve from "@rollup/plugin-node-resolve"
|
||||||
import json from "@rollup/plugin-json"
|
import json from "@rollup/plugin-json"
|
||||||
import { terser } from "rollup-plugin-terser"
|
|
||||||
import builtins from "rollup-plugin-node-builtins"
|
|
||||||
import globals from "rollup-plugin-node-globals"
|
|
||||||
import typescript from "@rollup/plugin-typescript"
|
import typescript from "@rollup/plugin-typescript"
|
||||||
import injectProcessEnv from "rollup-plugin-inject-process-env"
|
import polyfillNode from "rollup-plugin-polyfill-node"
|
||||||
import inject from "@rollup/plugin-inject"
|
import inject from "@rollup/plugin-inject"
|
||||||
|
import { terser } from "rollup-plugin-terser"
|
||||||
|
|
||||||
const production = !process.env.ROLLUP_WATCH
|
const production = !process.env.ROLLUP_WATCH
|
||||||
|
|
||||||
|
@ -27,18 +25,14 @@ const config = (input, outputFile, format) => ({
|
||||||
typescript({
|
typescript({
|
||||||
moduleResolution: "node",
|
moduleResolution: "node",
|
||||||
}),
|
}),
|
||||||
|
polyfillNode(), // Replaces Node.js built-ins for browser compatibility
|
||||||
resolve({
|
resolve({
|
||||||
preferBuiltins: true,
|
preferBuiltins: true,
|
||||||
browser: true,
|
browser: true,
|
||||||
}),
|
}),
|
||||||
commonjs(),
|
commonjs(),
|
||||||
globals(),
|
|
||||||
inject({ Buffer: ["buffer", "Buffer"] }),
|
|
||||||
builtins(),
|
|
||||||
json(),
|
json(),
|
||||||
injectProcessEnv({
|
inject({ Buffer: ["buffer", "Buffer"] }),
|
||||||
NO_JS: process.env.NO_JS,
|
|
||||||
}),
|
|
||||||
production && terser(),
|
production && terser(),
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
@ -46,5 +40,4 @@ const config = (input, outputFile, format) => ({
|
||||||
export default [
|
export default [
|
||||||
config("src/index.ts", "./dist/bundle.cjs", "cjs"),
|
config("src/index.ts", "./dist/bundle.cjs", "cjs"),
|
||||||
config("src/index.ts", "./dist/bundle.mjs", "esm"),
|
config("src/index.ts", "./dist/bundle.mjs", "esm"),
|
||||||
config("src/iife.ts", "./dist/iife.mjs", "esm"),
|
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue