0

rollup has a feature that allows for a custom output file name.
in the rollup.config.js file you can do this:

import pkg from './package.json';

export default {
  output: [{
    file: `build/${pkg.name}.browser.${pkg.version}.min.js`,
  }],
};

Let's say package.json includes "name": "test-package", "version": "1.1.2"
Running rollup -c produces the following output file:

build/test-package.browser.1.1.2.min.js

This is great for automating builds.
Does Snowpack offer something similar? It uses rollup internally so it could be possible, but I haven't been able to find a way of doing it in the documentation yet.

17xande
  • 2,430
  • 1
  • 24
  • 33

0 Answers0