-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
1,096 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,6 @@ | |
|
||
<style lang="scss"> | ||
#app { | ||
color: #{$textColor}; | ||
color: #{$text-color-primary}; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.