Pass the input as output without build output options
npm install --save-dev @qpitlove/rollup-plugin-input-through
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: "."
}),
],
}];
{
// `string: (path) => replacement` functions...
input: (id) => `'${path.dirname(id)}'`,
}
MIT