11cb0ef41Sopenharmony_ci// Copyright 2018 the V8 project authors. All rights reserved.
21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be
31cb0ef41Sopenharmony_ci// found in the LICENSE file.
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ciimport typescript from 'rollup-plugin-typescript2';
61cb0ef41Sopenharmony_ciimport node from 'rollup-plugin-node-resolve';
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ciimport path from 'path'
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_ciconst onwarn = warning => {
111cb0ef41Sopenharmony_ci  // Silence circular dependency warning for moment package
121cb0ef41Sopenharmony_ci  const node_modules = path.normalize('node_modules/');
131cb0ef41Sopenharmony_ci  if (warning.code === 'CIRCULAR_DEPENDENCY' &&
141cb0ef41Sopenharmony_ci    !warning.importer.indexOf(node_modules)) {
151cb0ef41Sopenharmony_ci    return
161cb0ef41Sopenharmony_ci  }
171cb0ef41Sopenharmony_ci
181cb0ef41Sopenharmony_ci  console.warn(`(!) ${warning.message}`)
191cb0ef41Sopenharmony_ci}
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_ciexport default {
221cb0ef41Sopenharmony_ci  input: "src/turbo-visualizer.ts",
231cb0ef41Sopenharmony_ci  plugins: [node(), typescript({
241cb0ef41Sopenharmony_ci    abortOnError: false
251cb0ef41Sopenharmony_ci  })],
261cb0ef41Sopenharmony_ci  output: {
271cb0ef41Sopenharmony_ci    file: "build/turbolizer.js",
281cb0ef41Sopenharmony_ci    format: "iife",
291cb0ef41Sopenharmony_ci    sourcemap: true
301cb0ef41Sopenharmony_ci  },
311cb0ef41Sopenharmony_ci  onwarn: onwarn
321cb0ef41Sopenharmony_ci};
33