All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.rollup.config.js Maven / Gradle / Ivy

There is a newer version: 3.2.0
Show newest version
import {terser} from "rollup-plugin-terser";
import * as meta from "./package.json";

const config = {
  input: "index.js",
  external: Object.keys(meta.dependencies || {}),
  output: {
    file: `dist/${meta.name}.js`,
    name: "d3",
    format: "umd",
    indent: false,
    extend: true,
    banner: `// ${meta.homepage} v${meta.version} Copyright ${(new Date).getFullYear()} ${meta.author.name}`,
    globals: Object.assign({}, ...Object.keys(meta.dependencies || {}).map(key => ({[key]: "d3"})))
  },
  plugins: []
};

export default [
  config,
  {
    ...config,
    output: {
      ...config.output,
      file: `dist/${meta.name}.min.js`
    },
    plugins: [
      ...config.plugins,
      terser({
        output: {
          preamble: config.output.banner
        }
      })
    ]
  }
];




© 2015 - 2024 Weber Informatics LLC | Privacy Policy