| // Copyright 2020 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // @ts-check |
| |
| import terser from '@rollup/plugin-terser'; |
| import sourcemaps from 'rollup-plugin-sourcemaps2'; |
| |
| import { devtoolsPlugin } from './devtools_plugin.js'; |
| |
| /** @type {function({configSourcemaps: boolean}): import("rollup").MergedRollupOptions} */ |
| |
| export default commandLineArgs => ({ |
| treeshake: false, |
| context: 'self', |
| maxParallelFileOps: 20, |
| output: [{ |
| format: 'esm', |
| sourcemap: Boolean(commandLineArgs.configSourcemaps), |
| }], |
| plugins: [ |
| terser(), |
| { |
| name: 'devtools-plugin', |
| resolveId(source, importer) { |
| return devtoolsPlugin(source, importer); |
| }, |
| }, |
| sourcemaps(), |
| ] |
| }); |