|
@@ -13,40 +13,53 @@ import glob from 'fast-glob'
|
|
// } from '@kankan-components/build-utils'
|
|
// } from '@kankan-components/build-utils'
|
|
|
|
|
|
export default defineConfig(async ({ mode }) => {
|
|
export default defineConfig(async ({ mode }) => {
|
|
- const env = loadEnv(mode, process.cwd(), '')
|
|
|
|
- // let { dependencies } = getPackageDependencies(epPackage)
|
|
|
|
- // dependencies = dependencies.filter((dep) => !dep.startsWith('@types/')) // exclude dts deps
|
|
|
|
- // const optimizeDeps = (
|
|
|
|
- // await glob(['dayjs/(locale|plugin)/*.js'], {
|
|
|
|
- // cwd: path.resolve(projRoot, 'node_modules'),
|
|
|
|
- // })
|
|
|
|
- // ).map((dep) => dep.replace(/\.js$/, ''))
|
|
|
|
- return {
|
|
|
|
- server: {
|
|
|
|
- host: true,
|
|
|
|
- https: !!env.HTTPS,
|
|
|
|
- port: 6868,
|
|
|
|
- proxy: {
|
|
|
|
- '/demoServer': {
|
|
|
|
- target: 'https://test.4dkankan.com',
|
|
|
|
- changeOrigin: true,
|
|
|
|
- rewrite: (path) => path.replace(/^\/demoServer/, ''),
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
|
|
+ const env = loadEnv(mode, process.cwd(), '')
|
|
|
|
+ // let { dependencies } = getPackageDependencies(epPackage)
|
|
|
|
+ // dependencies = dependencies.filter((dep) => !dep.startsWith('@types/')) // exclude dts deps
|
|
|
|
+ // const optimizeDeps = (
|
|
|
|
+ // await glob(['dayjs/(locale|plugin)/*.js'], {
|
|
|
|
+ // cwd: path.resolve(projRoot, 'node_modules'),
|
|
|
|
+ // })
|
|
|
|
+ // ).map((dep) => dep.replace(/\.js$/, ''))
|
|
|
|
+ return {
|
|
|
|
+ build: {
|
|
|
|
+ rollupOptions: {
|
|
|
|
+ input: {
|
|
|
|
+ index: path.resolve(__dirname, 'index.html'),
|
|
|
|
+ demo: path.resolve(__dirname, 'demo.html'),
|
|
},
|
|
},
|
|
- plugins: [
|
|
|
|
- //@ts-ignore
|
|
|
|
- VueMacros({
|
|
|
|
- setupComponent: false,
|
|
|
|
- setupSFC: false,
|
|
|
|
- plugins: {
|
|
|
|
- vue: vue(),
|
|
|
|
- vueJsx: vueJsx(),
|
|
|
|
- },
|
|
|
|
- }),
|
|
|
|
- ],
|
|
|
|
- optimizeDeps: {
|
|
|
|
- include: ['vue', '@vue/shared'],
|
|
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ server: {
|
|
|
|
+ host: true,
|
|
|
|
+ https: !!env.HTTPS,
|
|
|
|
+ port: 6868,
|
|
|
|
+ proxy: {
|
|
|
|
+ '/server-test': {
|
|
|
|
+ target: 'https://test.4dkankan.com',
|
|
|
|
+ changeOrigin: true,
|
|
|
|
+ rewrite: (path) => path.replace(/^\/server-test/, ''),
|
|
},
|
|
},
|
|
- }
|
|
|
|
|
|
+ '/server-prod': {
|
|
|
|
+ target: 'https://www.4dkankan.com',
|
|
|
|
+ changeOrigin: true,
|
|
|
|
+ rewrite: (path) => path.replace(/^\/server-prod/, ''),
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ plugins: [
|
|
|
|
+ //@ts-ignore
|
|
|
|
+ VueMacros({
|
|
|
|
+ setupComponent: false,
|
|
|
|
+ setupSFC: false,
|
|
|
|
+ plugins: {
|
|
|
|
+ vue: vue(),
|
|
|
|
+ vueJsx: vueJsx(),
|
|
|
|
+ },
|
|
|
|
+ }),
|
|
|
|
+ ],
|
|
|
|
+ optimizeDeps: {
|
|
|
|
+ include: ['vue', '@vue/shared'],
|
|
|
|
+ },
|
|
|
|
+ }
|
|
})
|
|
})
|