|
1 | 1 | import { defineConfig } from 'vite'; |
2 | | -import vue from '@vitejs/plugin-vue'; |
| 2 | +// import vue from '@vitejs/plugin-vue'; |
3 | 3 | import path from 'path'; |
4 | 4 | import dts from 'vite-plugin-dts'; |
5 | | -import react from '@vitejs/plugin-react'; |
| 5 | +// import react from '@vitejs/plugin-react'; |
6 | 6 | import packageJson from './package.json'; |
7 | 7 |
|
8 | 8 | const perDepsKeys = Object.keys(packageJson.peerDependencies); |
@@ -44,13 +44,13 @@ export default defineConfig({ |
44 | 44 | generateBundle(options, bundle) { |
45 | 45 | for (const fileName in bundle) { |
46 | 46 | const chunk = bundle[fileName]; |
47 | | - // if (fileName.includes('router-v6') && chunk.type === 'chunk') { |
48 | | - // chunk.code = chunk.code.replace( |
49 | | - // // Match 'react-router-dom/' followed by single quotes, double quotes, or backticks, replacing only 'react-router-dom/' to react-router-v6 dist file structure |
50 | | - // /react-router-dom\/(?=[\'\"\`])/g, |
51 | | - // 'react-router-dom/dist/index.js', |
52 | | - // ); |
53 | | - // } |
| 47 | + if (fileName.includes('router-v6') && chunk.type === 'chunk') { |
| 48 | + chunk.code = chunk.code.replace( |
| 49 | + // Match 'react-router-dom/' followed by single quotes, double quotes, or backticks, replacing only 'react-router-dom/' to react-router-v6 dist file structure |
| 50 | + /react-router-dom\/(?=[\'\"\`])/g, |
| 51 | + 'react-router-dom/dist/index.js', |
| 52 | + ); |
| 53 | + } |
54 | 54 |
|
55 | 55 | if (fileName.includes('router-v5') && chunk.type === 'chunk') { |
56 | 56 | chunk.code = chunk.code.replace( |
|
0 commit comments