rollup/rollup-plugin-url

Does not support rollup experimentalCodeSplitting and rollup experimentalDynamicImport

lanjingling0510 opened this issue · 4 comments

Because CodeSplitting has no output.file option.

Hi! Could you provide an example(config and usage)? With examples i'll find solution faster

This is my configuration.

// rollup.config.js


import path from 'path';
import babel from 'rollup-plugin-babel';
import url from 'rollup-plugin-url';
let publicPath = '/lib/';


export default {
  input: [
    'src/index.js',
    'src/index2.js',
  ],

  experimentalCodeSplitting: true,

  experimentalDynamicImport: true,

  external: id => /babel-runtime/.test(id),

  plugins: [
    url({
      limit: 5 * 1024, // inline files < 5k, copy files > 10k
      include: ['**/*.wasm'], // defaults to .svg, .png, .jpg and .gif files
      emitFiles: true, // defaults to true
      publicPath: publicPath
    }),
    babel({
      presets: [
        [ 'env', {
          modules: false,
          targets: {
            browsers: [ 'last 2 versions', 'not ie <= 8' ],
          },
        }],
        'stage-1',
      ],
      exclude: [
        'node_modules/**',
        'src/flv2mp4/*.asm.js',
        'src/flv2mp4/*.wasm.js',
        'src/flv2mp4/*.wasm'
      ],
       plugins: [
        'external-helpers',
         'transform-runtime',
       ],
      externalHelpers: true,
      runtimeHelpers: true,
      babelrc: false,
    }),
  ],


  output: {
    format: 'es',
    dir: 'lib'
  }
};

Thanks! I will fix it ASAP

1.4.0 published on npm