Skip to content

qpitlove/rollup-plugin-input-through

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rollup-plugin-input-through

Pass the input as output without build output options

Installation

npm install --save-dev @qpitlove/rollup-plugin-input-through

Usage

Generally, you need to ensure that rollup-plugin-input-through goes before other things (like rollup-plugin-html2) in your plugins array.

// rollup.config.js
import fg from "fast-glob";
import inputThrough from "@qpitlove/rollup-plugin-input-through";
import html2 from "rollup-plugin-html2";

export default [{
  input: fg.sync(["src/*.js"]),
  plugins: [
    inputThrough({
      // input: ['src/mainA.js', 'src/mainB.js'],
      // output: ['dist/mainA.js', 'dist/mainB.js'],
      input: (val) => val.replace("src/", "dist/"),
    }),
    html2({
      template: "src/index.html",
      fileName: "index.html",
      onlinePath: "."
    }),
  ],
}];

Options

{
  // `string: (path) => replacement` functions...
  input: (id) => `'${path.dirname(id)}'`,
}

License

MIT

Packages

No packages published