|
| 1 | +import { defineConfig } from 'dumi'; |
| 2 | +import path from 'path'; |
| 3 | + |
| 4 | +let base: string | undefined; |
| 5 | +let publicPath: string | undefined; |
| 6 | + |
| 7 | +// Github Pages 部署时需要更换为自己的仓库名 |
| 8 | +if (process.env.NODE_ENV === 'production' && process.env.PREVIEW !== '1') { |
| 9 | + base = '/react-ui-library-tutorial'; |
| 10 | + publicPath = '/react-ui-library-tutorial/'; |
| 11 | +} |
| 12 | + |
| 13 | +export default defineConfig({ |
| 14 | + base, |
| 15 | + publicPath, |
| 16 | + title: 'Happy UI', |
| 17 | + outputPath: 'doc-site', |
| 18 | + resolve: { |
| 19 | + docDirs: ['docs'], |
| 20 | + atomDirs: [{ type: 'component', dir: 'src' }], |
| 21 | + }, |
| 22 | + exportStatic: {}, |
| 23 | + forkTSChecker: {}, |
| 24 | + extraBabelPlugins: [ |
| 25 | + [ |
| 26 | + 'import', |
| 27 | + { |
| 28 | + libraryName: '@zzzzw/happy-ui', |
| 29 | + libraryDirectory: '', |
| 30 | + customStyleName: (name) => path.resolve(__dirname, `src/${name}/style/index.ts`), |
| 31 | + }, |
| 32 | + ], |
| 33 | + ], |
| 34 | +}); |
0 commit comments