-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
Versions
- originjs: 1.0.3
- node: 14.19.0
- vite: 3.0.2
按照如下文件配置后,插件没有生效,commonjs代码没有被转成es代码,所以报错:The requested module '/_fusion/lib/index.js' does not provide an export named 'Affix'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { viteCommonjs } from '@originjs/vite-plugin-commonjs'
import * as path from 'path';
const projectRootDir = path.resolve(__dirname);
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: [
{ find: '@', replacement: path.resolve(projectRootDir, 'src') },
{
find: '@fusion',
replacement: path.resolve(projectRootDir, '_fusion'),
},
{
find: /^~(.*)$/,
replacement: '$1',
}
]
},
plugins: [ viteCommonjs(), react()],
})Metadata
Metadata
Assignees
Labels
No labels