3 Star 12 Fork 0

masx200/async-task-current-limiter

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rollup.config.mjs 2.40 KB
一键复制 编辑 原始数据 按行查看 历史
masx200 提交于 2022-03-26 16:07 . 优化
import { babel } from "@rollup/plugin-babel";
import commonjs from "@rollup/plugin-commonjs";
import json from "@rollup/plugin-json";
// import sourcemaps from "rollup-plugin-sourcemaps";
import resolve from "@rollup/plugin-node-resolve";
import { defineConfig } from "rollup";
import rollupExternalModules from "rollup-external-modules";
import { terser } from "rollup-plugin-terser";
// import typescript from "@rollup/plugin-typescript";
import typescript from "rollup-plugin-ts";
const mybabelplugin = babel({
sourcemap: true,
plugins: ["@babel/plugin-proposal-optional-catch-binding"],
presets: [
[
"@babel/preset-env",
{
targets: [
"last 1 edge version",
"last 1 safari version",
"last 1 chrome version",
"last 1 firefox version",
],
},
],
],
});
const myterserplugin = terser({
module: true,
// sourcemap: true,
toplevel: true,
output: {
comments: !1,
ascii_only: !0,
},
compress: {
toplevel: true,
unused: true,
drop_console: true,
drop_debugger: true,
pure_funcs: ["console.log"],
},
mangle: true,
});
export default defineConfig([
{
external: rollupExternalModules,
input: "./src/index.ts",
output: [
{
file: "./dist/index.js",
format: "esm",
sourcemap: true,
},
],
plugins: [
typescript({ transpiler: "typescript" }),
// typescript({ objectHashIgnoreUnknownHack: true }),
// sourcemaps(),
json(),
resolve(),
commonjs(),
myterserplugin,
],
},
{
external: rollupExternalModules,
input: "./dist/index.js",
output: [
// {
// file: "./dist/index.min.js",
// format: "esm",
// sourcemap: true,
// },
{
exports: "auto",
file: "./dist/index.min.cjs",
format: "cjs",
sourcemap: true,
},
],
plugins: [
mybabelplugin,
// sourcemaps(),
json(),
resolve(),
commonjs(),
myterserplugin,
],
},
]);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/masx200/async-task-current-limiter.git
[email protected]:masx200/async-task-current-limiter.git
masx200
async-task-current-limiter
async-task-current-limiter
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385