How to use @rollup/plugin-node-resolve - 5 common examples

To help you get started, we’ve selected a few @rollup/plugin-node-resolve 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
src: [`${options.rootDir}/native/*`],
          dest: options.output,
        },
      ],
      copyOnce: true,
    }),
    alias(options),
    url({
      limit: 0,
      fileName: '[dirname][name][extname]',
      publicPath: '/',
      sourceDir: path.resolve(options.cwd, options.rootDir),
      include: ['**/*.svg', '**/*.png', '**/*.jpg', '**/*.jpeg', '**/*.gif'],
    }),
    json(),
    resolve({
      dedupe: [
        'react',
        'object-assign',
        'prop-types',
        'scheduler',
        'react-reconciler',
      ],
      extensions,
      customResolveOptions: {
        moduleDirectory: 'node_modules',
      },
    }),
    commonjs({
      include: /node_modules/,
      namedExports,
      extensions,
github canvg / canvg / rollup.config.js View on Github external
tslint({
			exclude:    ['**/*.json', 'node_modules/**'],
			throwError: true
		}),
		commonjs(),
		standalone && globals(),
		typescript(),
		transpile && babel({
			extensions: [
				...DEFAULT_EXTENSIONS,
				'ts',
				'tsx'
			],
			runtimeHelpers: true
		}),
		standalone && resolve({
			preferBuiltins: false
		}),
		!process.env.ROLLUP_WATCH && standalone && minify({
			comments: false
		})
	].filter(Boolean);
}
github jledentu / vue-finder / rollup.config.js View on Github external
input: opts.entry,
    external: ["vue"],
    plugins: [
      css({
        output: "dist/vue-finder.css"
      }),
      vue({ compileTemplate: true, css: false }),
      alias({
        entries: [
          {
            find: "@",
            replacement: path.resolve("src")
          }
        ]
      }),
      resolve({
        browser: true,
        preferBuiltins: false,
        extensions: [".js", ".json", ".vue"]
      }),
      json(),
      babel({
        exclude: "node_modules/**",
        sourceMap: true,
        runtimeHelpers: true,
        extensions: [".js", ".jsx", ".vue"]
      }),
      commonjs(),
      filesize()
    ].concat(opts.plugins || []),
    output: {
      exports: "named",

@rollup/plugin-node-resolve

Locate and bundle third-party dependencies in node_modules

MIT
Latest version published 6 days ago

Package Health Score

100 / 100
Full package analysis

Popular @rollup/plugin-node-resolve functions