antv-l7/build/rollup-plugin-inline-worker.js

17 lines
362 B
JavaScript

import { createFilter } from 'rollup-pluginutils';
export default function inlineWorker(include) {
const filter = createFilter(include);
return {
name: 'inline-worker',
transform(code, id) {
if (!filter(id)) return;
return {
code: `export default ${JSON.stringify(code)};`,
map: { mappings: '' },
};
},
};
}