5 Star 17 Fork 3

masx200/webpack-react-vue-spa-awesome-config

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rollup.config.mjs 1.77 KB
一键复制 编辑 原始数据 按行查看 历史
masx200 提交于 2024-10-17 17:51 . rollup 4
import babel from "@rollup/plugin-babel";
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import { terser } from "rollup-plugin-terser";
import json from "@rollup/plugin-json";
import typescript from "rollup-plugin-ts";
import rollupExternalModules from "rollup-external-modules";
const manglecompressplugin = terser({
toplevel: true,
// sourcemap: true,
compress: true,
mangle: { properties: false },
output: {
ascii_only: !0,
comments: !1,
beautify: true,
},
});
const banner = `#!/usr/bin/env node\n`;
export default [
{
external: rollupExternalModules,
input: "./cli/index.ts",
output: [
{
banner,
file: "./bin/cli.js",
format: "commonjs",
sourcemap: true,
},
],
plugins: [
typescript(),
resolve(),
commonjs(),
json(),
babel({
babelHelpers: "bundled",
presets: ["@babel/preset-env"],
extensions: [".js", ".ts"],
}),
manglecompressplugin,
],
},
{
external: rollupExternalModules,
input: "./lib/index.ts",
output: [
{
file: "./bin/config.js",
format: "commonjs",
sourcemap: true,
},
],
plugins: [
typescript(),
resolve(),
commonjs(),
json(),
babel({
babelHelpers: "bundled",
presets: ["@babel/preset-env"],
extensions: [".js", ".ts"],
}),
manglecompressplugin,
],
},
];
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/masx200/webpack-react-vue-spa-awesome-config.git
git@gitee.com:masx200/webpack-react-vue-spa-awesome-config.git
masx200
webpack-react-vue-spa-awesome-config
webpack-react-vue-spa-awesome-config
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385