Skip to content

Commit

Permalink
feature: 主题模块
Browse files Browse the repository at this point in the history
  • Loading branch information
jsxiaosi committed Jan 6, 2022
1 parent 504eb4e commit 2630b28
Show file tree
Hide file tree
Showing 16 changed files with 1,096 additions and 138 deletions.
40 changes: 24 additions & 16 deletions build/vite/build.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
import { BuildOptions } from 'vite'
import { BuildOptions } from 'vite';

export function createViteBuild(): BuildOptions {
const viteBuild = {
// 指定输出路径
outDir: 'dist',
// 指定生成静态资源的存放路径
assetsDir: 'static',
// 启用/禁用 CSS 代码拆分。当启用时,在异步 chunk 中导入的 CSS 将内联到异步 chunk 本身,并在块加载时插入 如果禁用,整个项目中的所有 CSS 将被提取到一个 CSS 文件中。
cssCodeSplit: false,
// 构建后是否生成 source map 文件。
sourcemap: false,
// 启用/禁用 brotli 压缩大小报告。压缩大型输出文件可能会很慢,因此禁用该功能可能会提高大型项目的构建性能。
brotliSize: true,
// chunk 大小警告的限制(以 kbs 为单位)
chunkSizeWarningLimit: 2000,
}
return viteBuild
const viteBuild = {
target: 'es2015',
// 指定输出路径
outDir: 'dist',
// 指定生成静态资源的存放路径
assetsDir: 'static',
// 启用/禁用 CSS 代码拆分。当启用时,在异步 chunk 中导入的 CSS 将内联到异步 chunk 本身,并在块加载时插入 如果禁用,整个项目中的所有 CSS 将被提取到一个 CSS 文件中。
cssCodeSplit: false,
// 构建后是否生成 source map 文件。
sourcemap: false,
// 启用/禁用 brotli 压缩大小报告。压缩大型输出文件可能会很慢,因此禁用该功能可能会提高大型项目的构建性能。
brotliSize: false,
terserOptions: {
compress: {
keep_infinity: true,
// Used to delete console in production environment
drop_console: true,
},
},
// chunk 大小警告的限制(以 kbs 为单位)
chunkSizeWarningLimit: 2000,
};
return viteBuild;
}
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@

<style lang="scss">
#app {
color: #{$textColor};
color: #{$text-color-primary};
}
</style>
2 changes: 1 addition & 1 deletion src/components/Application/AppLocale.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

<style lang="scss" scoped>
.icon {
color: #{$textColor};
color: #{$text-color-primary};
font-size: 1em;
}
</style>
4 changes: 2 additions & 2 deletions src/components/Application/AppTheme.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
justify-content: space-between;
align-items: center;
background-color: 151515;
border: 1px solid #{$textColor};
border: 1px solid #{$text-color-primary};
padding: 0 6px;
font-size: 1em;
border-radius: 30px;
Expand All @@ -53,7 +53,7 @@
z-index: 1;
width: 18px;
height: 18px;
background-color: #{$textColor};
background-color: #{$text-color-primary};
border-radius: 50%;
transition: transform 0.5s, background-color 0.5s;
will-change: transform;
Expand Down
Loading

0 comments on commit 2630b28

Please sign in to comment.