How to use the rollup/dist/rollup.browser.js.rollup function in rollup

To help you get started, we’ve selected a few rollup examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github halfnelson / svelte-native / demo / app / component-loader.ts View on Github external
async function bundle(lookup) {
    let bundle
    try {
        bundle = await rollup.rollup({
            input: './App.svelte',
            external: (id: string) => {
                if (id[0] === '.') return false;
                if (id.endsWith('.svelte')) return false;
                if (id.startsWith('svelte')) return true;
                return true;
            },
            plugins: [{
                resolveId(importee, importer) {
                    if (importee in lookup) return importee;
                },
                load(id) {
                    if (id in lookup) {
                        return lookup[id];
                    }
                },