mirror of
https://github.com/stevenjoezhang/live2d-widget.git
synced 2024-11-24 13:50:33 +08:00
31 lines
708 B
JavaScript
31 lines
708 B
JavaScript
|
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
||
|
import { createFilter } from "@rollup/pluginutils";
|
||
|
|
||
|
function string(opts = {}) {
|
||
|
if (!opts.include) {
|
||
|
throw Error("include option should be specified");
|
||
|
}
|
||
|
|
||
|
const filter = createFilter(opts.include, opts.exclude);
|
||
|
|
||
|
return {
|
||
|
name: "string",
|
||
|
|
||
|
transform(code, id) {
|
||
|
if (filter(id)) {
|
||
|
return {
|
||
|
code: `export default ${JSON.stringify(code)};`,
|
||
|
map: { mappings: "" }
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
export default {
|
||
|
input: 'src/waifu-tips.js',
|
||
|
plugins: [nodeResolve(), string({
|
||
|
include: "**/*.svg",
|
||
|
})]
|
||
|
};
|