@solid-integrations/rollup
v0.0.300
Published
An integration for rollup
Downloads
1
Readme
@solid-integrations/rollup
A sample primitive that is made up for templating with the following options:
createCompiled
- Returns a resource containing the rollup output after bundling the given code.createCompiledCode
- Composes createCompiled - instead returning an accessor containing the bundled code.
Installation
npm install @solid-integrations/rollup
# or
yarn add @solid-integrations/rollup
# or
pnpm add @solid-integrations/rollup
How to use it
createCompiled
const [files, setFiles] = createSignal({
"main.js": "import {coolFun} from './coolFile.js'; coolFun()",
"coolFile.js": "export function coolFun(){console.log('Hello World')}",
});
const [compiled] = createCompiled(files);
console.log(compiled()); // Displays rollup's output from bundling the code.
// This includes extra metadata, rather than just the file itself
createCompiledCode
const [files, setFiles] = createSignal({
"main.js": "import {coolFun} from './coolFile.js'; coolFun()",
"coolFile.js": "export function coolFun(){console.log('Hello World')}",
});
const compiled = createCompiledCode(files);
console.log(compiled()); // Displays the bundled code generated by rollup
Changelog
See CHANGELOG.md