UNPKG

beesbuild

Version:

构建工具链

54 lines (53 loc) 1.67 kB
import { flattenDeep, isBoolean } from "lodash-unified"; import { vuePlugin } from "./vue.mjs"; import { replacePlugin } from "./replace.mjs"; import { nodeResolvePlugin } from "./nodeResolve.mjs"; import { jsonPlugin } from "./json.mjs"; import { shebangPlugin } from "./shebang.mjs"; import { esbuildPlugin } from "./esbuild.mjs"; import { commonjsPlugin } from "./commonjs.mjs"; import { dynamicPlugin } from "./dynamic.mjs"; import { cjsPlugin } from "./cjs.mjs"; import { rawPlugin } from "./raw.mjs"; var stdin_default = (ctx) => { const plugins = []; const rollup = ctx.options.rollup; if (!rollup) return []; const isVue = isBoolean(rollup.vue) ? rollup.vue : Boolean(rollup.vue); plugins.push( vuePlugin( { vue: rollup.vue, vueJsx: rollup.vueJsx, vueMacros: rollup.vueMacros }, ctx ) ); if (!isVue) { plugins.push(replacePlugin(rollup == null ? void 0 : rollup.replace, ctx)); } plugins.push(nodeResolvePlugin(rollup == null ? void 0 : rollup.resolve, ctx), jsonPlugin(rollup == null ? void 0 : rollup.json, ctx)); if (!isVue) { plugins.push(shebangPlugin()); } if (!isVue) { plugins.push(cjsPlugin(rollup == null ? void 0 : rollup.cjsBridge, ctx)); } plugins.push( esbuildPlugin( { sourcemap: ctx.options.sourcemap, ...rollup == null ? void 0 : rollup.esbuild }, ctx ), commonjsPlugin(rollup == null ? void 0 : rollup.commonjs, ctx), rawPlugin(), dynamicPlugin(rollup == null ? void 0 : rollup.preserveDynamicImports, ctx) ); return flattenDeep(plugins).filter(Boolean); }; export { stdin_default as default };