|
|
@ -1,4 +1,9 @@
|
|
|
|
const path = require('path');
|
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
const copy = require('rollup-plugin-copy');
|
|
|
|
|
|
|
|
const normalize = require('normalize-path');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const pluginRoot = path.resolve(__dirname, './web');
|
|
|
|
|
|
|
|
const outDir = path.resolve(__dirname, '../../public');
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
module.exports = {
|
|
|
|
externalDeps: [
|
|
|
|
externalDeps: [
|
|
|
@ -9,6 +14,24 @@ module.exports = {
|
|
|
|
'zustand',
|
|
|
|
'zustand',
|
|
|
|
'zustand/middleware/immer',
|
|
|
|
'zustand/middleware/immer',
|
|
|
|
],
|
|
|
|
],
|
|
|
|
pluginRoot: path.resolve(__dirname, './web'),
|
|
|
|
pluginRoot,
|
|
|
|
outDir: path.resolve(__dirname, '../../public'),
|
|
|
|
outDir,
|
|
|
|
|
|
|
|
rollupPlugins: ({ pluginName }) => [
|
|
|
|
|
|
|
|
copy({
|
|
|
|
|
|
|
|
targets: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
src: path.resolve(
|
|
|
|
|
|
|
|
pluginRoot,
|
|
|
|
|
|
|
|
`./plugins/${pluginName}`,
|
|
|
|
|
|
|
|
'./assets/**/*'
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
dest: path.resolve(outDir, `./plugins/${pluginName}/assets/`),
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
].map((item) => ({
|
|
|
|
|
|
|
|
// For windows
|
|
|
|
|
|
|
|
src: normalize(item.src),
|
|
|
|
|
|
|
|
dest: normalize(item.dest, false),
|
|
|
|
|
|
|
|
})),
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
],
|
|
|
|
};
|
|
|
|
};
|
|
|
|