| | |
| | | |
| | | chain.plugin('unplugin-auto-import').use( |
| | | AutoImport({ |
| | | imports: ['vue', 'pinia', 'vue-router', { '@/constants': ['RouterPath'] }], |
| | | dirs: ['./src/constants/**', './src/hooks/**'], |
| | | // dirsScanOptions: { |
| | | // fileFilter: (file) => file.endsWith('.ts'), // Filter files |
| | | // types: true, |
| | | // }, |
| | | vueTemplate: true, |
| | | imports: ['vue', 'pinia', 'vue-router'], |
| | | eslintrc: { |
| | | enabled: true, // Default `false` |
| | | filepath: './.eslintrc-auto-import.json', // Default `./.eslintrc-auto-import.json` |
| | |
| | | }) |
| | | ); |
| | | |
| | | chain.merge({ |
| | | plugin: { |
| | | install: { |
| | | plugin: require('terser-webpack-plugin'), |
| | | args: [ |
| | | { |
| | | terserOptions: { |
| | | compress: true, // 默认使用terser压缩 |
| | | keep_classnames: true, // 不改变class名称 |
| | | keep_fnames: true, // 不改变函数名称 |
| | | if (process.env.NODE_ENV !== 'development') { |
| | | chain.merge({ |
| | | plugin: { |
| | | install: { |
| | | plugin: require('terser-webpack-plugin'), |
| | | args: [ |
| | | { |
| | | terserOptions: { |
| | | compress: true, // 默认使用terser压缩 |
| | | keep_classnames: true, // 不改变class名称 |
| | | keep_fnames: true, // 不改变函数名称 |
| | | }, |
| | | }, |
| | | }, |
| | | ], |
| | | ], |
| | | }, |
| | | }, |
| | | }, |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | chain.merge({ |
| | | optimization: { |