Skip to content

Commit

Permalink
fix(build): fix the public path
Browse files Browse the repository at this point in the history
  • Loading branch information
DesnLee committed Jul 6, 2022
1 parent a479ef0 commit 550ae85
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
VITE_PORT = 8888

# 配置线上环境资源 url(打包)、本地开发置空
VITE_PUBLIC_PATH = ''
VITE_PUBLIC_PATH = '/'
Binary file modified src/assets/icons/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions src/components/PreviewPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
</template>

<script lang="ts" setup>
import surge from '@/assets/icons/surge.png?url'
import clash from '@/assets/icons/clash.png?url'
import quanx from '@/assets/icons/quanx.png?url'
import loon from '@/assets/icons/loon.png?url'
import stash from '@/assets/icons/stash.png?url'
import surge from '@/assets/icons/surge.png';
import clash from '@/assets/icons/clash.png';
import quanx from '@/assets/icons/quanx.png';
import loon from '@/assets/icons/loon.png';
import stash from '@/assets/icons/stash.png';
const { name, type } = defineProps<{
name: string
type: 'sub' | 'collection'
}>()
const host = import.meta.env.VITE_API_URL
name: string;
type: 'sub' | 'collection';
}>();
const host = import.meta.env.VITE_API_URL;
const platformList = [
{
name: 'Clash',
Expand Down Expand Up @@ -55,7 +55,7 @@
path: 'Stash',
icon: stash,
},
]
];
</script>

<style lang="scss" scoped>
Expand Down
4 changes: 1 addition & 3 deletions src/components/SubListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
<div class="sub-img-wrapper">
<nut-avatar
class="sub-item-customer-icon"
v-if="props[props.type].icon"
size="60"
:url="props[props.type].icon"
:url="props[props.type].icon || icon"
bg-color=""
></nut-avatar>
<nut-avatar v-else :icon="icon"></nut-avatar>
</div>
<div class="sub-item-content">
<div class="sub-item-title-wrapper">
Expand Down
4 changes: 2 additions & 2 deletions src/views/My.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@
</template>

<script lang="ts" setup>
import iconKey from '@/assets/icons/key-solid.svg?url';
import iconUser from '@/assets/icons/user-solid.svg?url';
import iconKey from '@/assets/icons/key-solid.svg';
import iconUser from '@/assets/icons/user-solid.svg';
import surge from '@/assets/icons/surge.png?url';
import clash from '@/assets/icons/clash.png?url';
Expand Down
10 changes: 2 additions & 8 deletions src/views/SubEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,6 @@
:url="item[2]"
bg-color=""
></nut-avatar>
<nut-avatar
class="sub-item-customer-icon"
size="32"
v-else
:icon="icon"
></nut-avatar>
<span>{{ item[1] }}</span>
</div>
</nut-checkbox>
Expand Down Expand Up @@ -206,7 +200,7 @@
</template>

<script lang="ts" setup>
import icon from '@/assets/icons/logo.png?url';
import icon from '@/assets/icons/logo.png';
import { useRoute, useRouter } from 'vue-router';
import { useSubsStore } from '@/store/subs';
import {
Expand Down Expand Up @@ -253,7 +247,7 @@
return [
item.name,
item.displayName || item['display-name'] || item.name,
item.icon || null,
item.icon || icon,
];
});
});
Expand Down
8 changes: 3 additions & 5 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import * as path from 'path';
import {
createStyleImportPlugin,
} from 'vite-plugin-style-import';
import { createStyleImportPlugin } from 'vite-plugin-style-import';
import monacoEditorPlugin from 'vite-plugin-monaco-editor';
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons';
import { defineConfig, loadEnv, ConfigEnv } from 'vite';
import vue from '@vitejs/plugin-vue';

const alias: Record<string, string> = {
'@': path.resolve(__dirname, 'src'),
'@': path.resolve(__dirname, '/src'),
};

const viteConfig = defineConfig((mode: ConfigEnv) => {
Expand All @@ -23,7 +21,7 @@ const viteConfig = defineConfig((mode: ConfigEnv) => {
{
libraryName: '@nutui/nutui',
esModule: true,
resolveStyle: (name) => {
resolveStyle: name => {
name = name.toLowerCase().replace('-', ''); //NutuiResolve官方版目前在linux会造成大小写不一致问题无法加载资源
return `@nutui/nutui/dist/packages/${name}/index.scss`;
},
Expand Down

0 comments on commit 550ae85

Please sign in to comment.