svelte file and its various imports, props, etc., into HTML, CSS, and JavaScript files. It takes modular code, like our Svelte app, and bundles it into files that browsers can readily parse and display to users. in your code you have a literal ENV.MINIFY and the replace plugin will replace it with either true or false. Rollup is a module bundler for JavaScript applications. Rollup also uses a tree-shaking approach to bundling, removing unused pieces of code which could bulk your module unnecessarily. It uses the standardized module format introduced in ES6. If you want to pass these to the bundle, you will need to use plugin-replace. Rollup.js is a module bundler for JavaScript: it gets pieces of code that are dependent on each other to create a larger, self-contained module. Rollup plugin to minify generated bundles using esbuild. But what option is there for a pipeline like mine, that creates a js and a separate css artifact? const resolve = require('rollup-plugin-node-resolve') Ĭonst babel = require('rollup-plugin-babel') Ĭonst replace = require('rollup-plugin-replace') // use to setup project enviroment variablesĬonst sass = require('rollup-plugin-sass') Ĭonst json = require('rollup-plugin-json') Ĭonst image = require('rollup-plugin-image') Ĭonst reactSvg = require('rollup-plugin-react-svg') Ĭonst babelOptions = JSON.parse(fs.readFileSync('.babelrc')) Īs you see, I only have an index.js file as input and output, but on the way I'm outputting the css separately. This is not for the runtime, it's for the build process, Rollup runs in Node.js regardless of whether you are targeting Node or the browser. I know that node-sass can minify css by default.
0 Comments
Leave a Reply. |