Skip to content

Commit

Permalink
chore: Fix nutui resolve bug
Browse files Browse the repository at this point in the history
# feat/fix/docs/refactor/perf/test/style/revert/chore(scope/issue): changelog

# Modify issues if necessary
# Details if any
  • Loading branch information
Peng-YM committed Jul 5, 2022
1 parent 5831303 commit 0a08dfa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ dist-ssr
*.njsproj
*.sln
*.sw?
.vercel
13 changes: 11 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as path from 'path';
import {
createStyleImportPlugin,
NutuiResolve,
} from 'vite-plugin-style-import';
import monacoEditorPlugin from 'vite-plugin-monaco-editor';
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons';
Expand All @@ -19,7 +18,17 @@ const viteConfig = defineConfig((mode: ConfigEnv) => {
plugins: [
vue(),
createStyleImportPlugin({
resolves: [NutuiResolve()],
// resolves: [NutuiResolve()],
libs: [
{
libraryName: '@nutui/nutui',
esModule: true,
resolveStyle: (name) => {
name = name.toLowerCase().replace('-', ''); //NutuiResolve官方版目前在linux会造成大小写不一致问题无法加载资源
return `@nutui/nutui/dist/packages/${name}/index.scss`;
},
},
],
}),
createSvgIconsPlugin({
iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
Expand Down

0 comments on commit 0a08dfa

Please sign in to comment.