How to use @rollup/plugin-commonjs - 3 common examples

To help you get started, we’ve selected a few @rollup/plugin-commonjs 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 datawrapper / datawrapper / src / rollup.config.js View on Github external
(err, result) => {
                                    if (err) return reject(err);

                                    resolve({
                                        code: result.css.toString(),
                                        map: result.map.toString()
                                    });
                                }
                            );
                        });
                    }
                }
            }),

            resolve(),
            commonjs(),
            json(),

            babel({
                // don't exclude anything!
                // exclude: [/node_modules\/(?!(@datawrapper|svelte)\/).*/],
                extensions: ['.js', '.mjs', '.html'],
                babelHelpers: 'runtime',
                presets: [
                    [
                        '@babel/env',
                        {
                            targets: 'last 2 versions, not IE 10, not dead',
                            corejs: 3,
                            useBuiltIns: 'entry'
                        }
                    ]
github datawrapper / datawrapper / src / v2 / rollup.config.js View on Github external
(err, result) => {
                                    if (err) return reject(err);

                                    resolve({
                                        code: result.css.toString(),
                                        map: result.map.toString()
                                    });
                                }
                            );
                        });
                    }
                }
            }),

            resolve(),
            commonjs(),
            json(),

            babel({
                // don't exclude anything!
                // exclude: [/node_modules\/(?!(@datawrapper|svelte)\/).*/],
                extensions: ['.js', '.mjs', '.html'],
                babelHelpers: 'runtime',
                presets: [
                    [
                        '@babel/env',
                        {
                            targets: 'last 2 versions, not IE 10, not dead',
                            corejs: 3,
                            useBuiltIns: 'entry'
                        }
                    ]
github remaxjs / remax / packages / remax-cli / src / build / rollupConfig.ts View on Github external
}),
    json(),
    resolve({
      dedupe: [
        'react',
        'object-assign',
        'prop-types',
        'scheduler',
        'react-reconciler',
      ],
      extensions,
      customResolveOptions: {
        moduleDirectory: 'node_modules',
      },
    }),
    commonjs({
      include: /node_modules/,
      namedExports,
      extensions,
      ignoreGlobal: false,
    }),
    stub({
      modules: stubModules,
    }),
    babel({
      include: entries.pages.map(p => p.file),
      extensions: without(extensions, '.json'),
      usePlugins: [nativeComponentsBabelPlugin(options, adapter), page],
      reactPreset: false,
    }),
    babel({
      include: entries.app,

@rollup/plugin-commonjs

Convert CommonJS modules to ES2015

MIT
Latest version published 6 months ago

Package Health Score

91 / 100
Full package analysis

Popular @rollup/plugin-commonjs functions