rollup.config.mjs (1107B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 import terser from "@rollup/plugin-terser"; 6 import nodeResolve from "@rollup/plugin-node-resolve"; 7 import commonjs from "@rollup/plugin-commonjs"; 8 import json from "@rollup/plugin-json"; 9 10 export default function (commandLineArgs = {}) { 11 const plugins = [ 12 nodeResolve({ 13 browser: true, 14 dedupe: [ 15 "prosemirror-commands", 16 "prosemirror-history", 17 "prosemirror-keymap", 18 "prosemirror-markdown", 19 "prosemirror-model", 20 "prosemirror-schema-basic", 21 "prosemirror-state", 22 "prosemirror-transform", 23 "prosemirror-view", 24 ], 25 }), 26 commonjs(), 27 json(), 28 ]; 29 30 if (commandLineArgs.configMinify) { 31 plugins.push(terser()); 32 } 33 34 return { 35 input: "bundle_entry.mjs", 36 output: { 37 file: "prosemirror.bundle.mjs", 38 format: "esm", 39 sourcemap: false, 40 }, 41 plugins, 42 treeshake: true, 43 }; 44 }