Closed jiangyong1998 closed 1 year ago
We temporarily close this due to the lack of enough information. Please provide a minimal reproduction to reopen the issue. Thanks.
We temporarily close this due to the lack of enough information. Please provide a minimal reproduction to reopen the issue. Thanks.
Thank you for your answer. This is a packaged product that I used in the Vue2 project dist.zip
const config = { input: path.resolve(_dirname, "src/index.ts"), output: [ { file: pkg.main, format: "cjs", }, { file: pkg.module, format: "es", }, { name: "jhooks", file: pkg.umd, format: "umd", globals: { dayjs: "dayjs", lodash: "", }, }, ], plugins: [ resolve(), commonjs(), rollupTypescript(), strip(), babel({ exclude: "node_modules/**", babelHelpers: "runtime", extensions: [...DEFAULT_EXTENSIONS, ".ts"], }), env === "production" && terser({ compress: { pure_getters: true, unsafe: true, unsafe_comps: true, warnings: false, }, }), ], external: ["lodash", "dayjs"], };
export default config;
{ "devDependencies": { "@babel/core": "^7.22.10", "@babel/plugin-proposal-class-properties": "^7.18.6", "@babel/plugin-transform-runtime": "^7.22.10", "@babel/preset-env": "^7.22.10", "@rollup/plugin-babel": "^5.3.1", "@rollup/plugin-commonjs": "^21.0.3", "@rollup/plugin-node-resolve": "^13.1.3", "@rollup/plugin-strip": "^3.0.2", "@types/lodash": "^4.14.196", "rimraf": "^3.0.2", "rollup": "^2.70.1", "rollup-plugin-terser": "^7.0.2", "rollup-plugin-typescript2": "^0.31.2", "typescript": "^4.6.3" }, "dependencies": { "@babel/runtime-corejs3": "^7.22.10", "vue-demi": "^0.14.5" }, "peerDependencies": { "@vue/composition-api": "^1.0.0-beta.1", "dayjs": "^1.11.9", "lodash": "^4.17.21", "vue": "^2.0.0 || >=3.0.0-rc.0" }, "files": [ "dist" ] }
module.exports = { presets: [ [ "@babel/preset-env", { modules: false, }, ], ], plugins: [ "@babel/plugin-proposal-class-properties", [ "@babel/plugin-transform-runtime", { corejs: 3, }, ], ], ignore: ["node_modules/**"], };