mirror of
https://github.com/lobehub/sd-webui-lobe-theme.git
synced 2026-01-09 06:23:44 +08:00
38 lines
830 B
TypeScript
38 lines
830 B
TypeScript
import { defineConfig } from 'umi'
|
|
import WebpackShellPlugin from 'webpack-shell-plugin-next'
|
|
|
|
const mac = [
|
|
'rm ./javascript/index.js',
|
|
'rm ./style.css',
|
|
'cp ./dist/index.js ./javascript/index.js',
|
|
'cp ./dist/index.css ./style.css',
|
|
]
|
|
|
|
const win = [
|
|
'del javascript\\index.js',
|
|
'del style.css',
|
|
'copy dist\\index.js javascript\\index.js',
|
|
'copy dist\\index.css style.css',
|
|
]
|
|
|
|
export default defineConfig({
|
|
routes: [{ path: '/', component: 'index' }],
|
|
npmClient: 'yarn',
|
|
mpa: {},
|
|
codeSplitting: false,
|
|
define: {
|
|
'process.env': process.env,
|
|
},
|
|
chainWebpack(memo) {
|
|
memo.plugin('shell').use(WebpackShellPlugin, [
|
|
{
|
|
onBuildExit: {
|
|
scripts: process.platform === 'win32' ? win : mac,
|
|
blocking: false,
|
|
parallel: false,
|
|
},
|
|
},
|
|
])
|
|
},
|
|
})
|