A
A
Alexey Nikolaev2020-06-28 18:46:18
JavaScript
Alexey Nikolaev, 2020-06-28 18:46:18

How to force Rollup to assemble assembly in one file?

Good day.
There is Rollup 1.29, there is a simple config. You need to end up with a minified library file.

export default {
  input: 'src/index.js',
  plugins: [
    resolve({
      mainFields: ["module", "jsnext:main", "main", "browser"]
    }),
    vue({
      css: true,
    }),
    babel({
      exclude: 'node_modules/**',
      babelHelpers: 'runtime',
      extensions: ['.js', '.jsx', '.es6', '.es', '.mjs', '.vue'],
    }),
    cjs(),
    replace({
      VERSION: JSON.stringify(config.version),
    }),
    postcss(),
    terser(),
    analyze(),
  ],
  output: [{
    file: 'dist/libdary.min.js',
    format: 'es',
  }],
};

As a result, I get an error: " Error: You must set "output.dir" instead of "output.file" when generating multiple chunks ".

How to eliminate? I explicitly stated that I want one output file.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question