UNPKG

dab-js-without-registry

Version:
41 lines (38 loc) 1.23 kB
import svelte from "rollup-plugin-svelte" import resolve from "@rollup/plugin-node-resolve" import commonjs from "@rollup/plugin-commonjs" import json from "@rollup/plugin-json" import { terser } from "rollup-plugin-terser" import bundleSize from "rollup-plugin-bundle-size" import typescript from "rollup-plugin-typescript2" import pkg from "./package.json" import nodePolyfills from "rollup-plugin-node-polyfills" import alias from "@rollup/plugin-alias" import babel from "@rollup/plugin-babel" const production = !process.env.ROLLUP_WATCH const name = pkg.name .replace(/^(@\S+\/)?(dab-)?(\S+)/, "$3") .replace(/^\w/, (m) => m.toUpperCase()) .replace(/-\w/g, (m) => m[1].toUpperCase()) export default { input: "src/index.ts", output: [ { file: pkg.module, sourcemap: true, format: "es", inlineDynamicImports: true, }, { file: pkg.main, sourcemap: true, format: "umd", name, inlineDynamicImports: true, }, ], plugins: [ typescript(), json(), // nodePolyfills(), commonjs(), // resolve(), production && terser(), production && bundleSize(), ], external: {}, globals: {}, }