How to use the delaunator/package.json.version function in delaunator

To help you get started, we’ve selected a few delaunator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github d3 / d3-delaunay / rollup.config.js View on Github external
import noderesolve from "rollup-plugin-node-resolve";
import {terser} from "rollup-plugin-terser";
import * as meta from "./package.json";

const config = {
  input: "src/index.js",
  external: Object.keys(meta.dependencies || {}).filter(key => /^d3-/.test(key)),
  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}
// https://github.com/mapbox/delaunator v${require("delaunator/package.json").version}. Copyright 2019 Mapbox, Inc.`,
    globals: Object.assign({}, ...Object.keys(meta.dependencies || {}).filter(key => /^d3-/.test(key)).map(key => ({[key]: "d3"})))
  },
  plugins: [
    noderesolve()
  ]
};

export default [
  config,
  {
    ...config,
    output: {
      ...config.output,
      file: `dist/${meta.name}.min.js`
    },
    plugins: [

delaunator

An incredibly fast JavaScript library for Delaunay triangulation of 2D points

ISC
Latest version published 10 months ago

Package Health Score

83 / 100
Full package analysis