view service/mqtt_to_rdf/rollup.config.js @ 1574:6618d481421c dependabot/pip/service/colplay/pillow-8.1.1

Bump pillow from 3.1.1 to 8.1.1 in /service/colplay Bumps [pillow](https://github.com/python-pillow/Pillow) from 3.1.1 to 8.1.1. - [Release notes](https://github.com/python-pillow/Pillow/releases) - [Changelog](https://github.com/python-pillow/Pillow/blob/master/CHANGES.rst) - [Commits](https://github.com/python-pillow/Pillow/compare/3.1.1...8.1.1) Signed-off-by: dependabot[bot] <support@github.com>
author dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
date Thu, 18 Mar 2021 20:13:07 +0000
parents a598d2141587
children e0e623c01a69
line wrap: on
line source

import builtins from "rollup-plugin-node-builtins";
import commonjs from "@rollup/plugin-commonjs";
import resolve from "@rollup/plugin-node-resolve";
import typescript from "rollup-plugin-typescript2";
import replace from "@rollup/plugin-replace";

const workaround_jsonld_module_system_picker = "process = {version: '1.0.0'}";
const workaround_some_browser_detector = "global = window";
const workaround_jsonld_expand_issue = {
  namedExports: {
    jsonld: ["expand"], // fixes "expand is not exported by node_modules/jsonld/lib/index.js"
    '../../../streamed-graph/node_modules/jsonld/lib/index': ['expand'],
  }
};

// This makes <dom-module> element totally unavailable. I only meant to prune one of the
// two, but of course why is streamed-graph's node_modules/**/dom-module.js file getting 
// here in the first place?
const duplicated_line_i_cant_prune =
  "customElements.define('dom-module', DomModule);";
const replacements = {};
replacements[duplicated_line_i_cant_prune] = "";

export default {
  input: "src/index.ts",
  output: {
    file: "build/bundle.js",
    format: "esm",
    intro: `const ${workaround_some_browser_detector}, ${workaround_jsonld_module_system_picker};`,
  },
  external: [
    "dom-module", // don't want two of these in the bundle
  ],
  plugins: [
    builtins(),
    resolve({
      extensions: [".js", ".ts"],
      browser: true,
    }),
    typescript(),
    commonjs(workaround_jsonld_expand_issue),
    replace({ ...replacements, delimiters: ["", ""] }),
  ],
};