mirror of https://gitee.com/antv-l7/antv-l7
17 lines
362 B
JavaScript
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: '' },
|
||
|
};
|
||
|
},
|
||
|
};
|
||
|
}
|