How to use @open-wc/building-rollup - 3 common examples

To help you get started, we’ve selected a few @open-wc/building-rollup 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 uprtcl / js-uprtcl / demos / simple-editor / rollup.config.js View on Github external
import { createDefaultConfig } from '@open-wc/building-rollup';
import commonjs from 'rollup-plugin-commonjs';
import resolve from 'rollup-plugin-node-resolve';
import json from 'rollup-plugin-json';
import builtins from 'rollup-plugin-node-builtins';
import globals from 'rollup-plugin-node-globals';
import replace from 'rollup-plugin-replace';

const config = createDefaultConfig({ input: './index.html' });

// map if you use an array of configs, otherwise just extend the config
export default {
  ...config,
  plugins: [
    replace({
      'process.env.NODE_ENV': JSON.stringify('development')
    }),
    resolve({ browser: true }),
    // Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs)
    commonjs(),
    ...config.plugins,
    // Allow json resolution
    json()
  ],
  external: [],
github open-wc / open-wc / packages / demoing-storybook / src / build / build.js View on Github external
async function buildPreview(outputDir, assets) {
  const configs = createCompatibilityConfig({
    input: 'noop',
    extensions: [...DEFAULT_EXTENSIONS, 'mdx'],
    plugins: { indexHTML: false },
  });

  configs[0].output.dir = path.join(outputDir, 'legacy');
  configs[1].output.dir = outputDir;

  configs[0].plugins.unshift(
    indexHTML({
      indexFilename: 'iframe.html',
      indexHTMLString: assets.iframeHTML,
      multiBuild: true,
      legacy: true,
      polyfills: {
        dynamicImport: true,
github web-padawan / api-viewer-element / rollup.config.js View on Github external
import cpy from 'rollup-plugin-cpy';
import { createDefaultConfig } from '@open-wc/building-rollup';

const config = createDefaultConfig({
  input: './demo/index.html',
  indexHTMLPlugin: {
    minify: false
  }
});

export default {
  ...config,
  plugins: [
    ...config.plugins,
    cpy({
      files: ['demo/*.css'],
      dest: 'dist'
    })
  ]
};

@open-wc/building-rollup

Default configuration for working with rollup

MIT
Latest version published 16 days ago

Package Health Score

90 / 100
Full package analysis