src/index.js
function (id) {
            if (!paths.has(id)) {
                return;
            }

            var code = [
                    `import shimWorker from 'rollup-plugin-bundle-worker';`,
                    `export default new shimWorker(${JSON.stringify(paths.get(id))}, function (window, document) {`,
                    `var self = this;`,
                    fs.readFileSync(id, 'utf-8'),
                    `\n});`
                ].join('\n');

            return code;
        }
function (id) {
            if (!paths.has(id)) {
                return;
            }

            var code = [
                    `import shimWorker from 'rollup-plugin-bundle-worker';`,
                    `export default new shimWorker(${JSON.stringify(paths.get(id))}, function (window, document) {`,
                    `var self = this;`,
                    fs.readFileSync(id, 'utf-8'),
                    `\n});`
                ].join('\n');

            return code;
        }
function ( id ) { if ( ! paths . has ( id ) ) { return ; } var code = [ ` ` , ` ${ JSON . stringify ( paths . get ( id ) ) } ` , ` ` , fs . readFileSync ( id , 'utf-8' ) , ` \n ` ] . join ( '\n' ) ; return code ; }
Do everything in load so that code loaded by the plugin can still be transformed by the
rollup configuration
Do everything in load so that code loaded by the plugin can still be transformed by the rollup configuration