Skip to content

Commit

Permalink
chore(build): keep same hash for the same files (#3878)
Browse files Browse the repository at this point in the history
* fix: state mutations in computed getters should be avoided

* fix: type about getDataSourceRef

* chore(build): keep same hash for the same files
  • Loading branch information
xachary authored May 31, 2024
1 parent d9cdf3f commit a6086f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/vite-config/src/config/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function defineApplicationConfig(defineOptions: DefineOptions = {}) {
});

const pathResolve = (pathname: string) => resolve(root, '.', pathname);
const timestamp = new Date().getTime();

const applicationConfig: UserConfig = {
base: VITE_PUBLIC_PATH,
resolve: {
Expand All @@ -63,8 +63,8 @@ function defineApplicationConfig(defineOptions: DefineOptions = {}) {
cssTarget: 'chrome80',
rollupOptions: {
output: {
// 入口文件名
entryFileNames: `assets/entry/[name]-[hash]-${timestamp}.js`,
// 入口文件名(不能变,否则所有打包的 js hash 值全变了)
entryFileNames: 'index.js',
manualChunks: {
vue: ['vue', 'pinia', 'vue-router'],
antd: ['ant-design-vue', '@ant-design/icons-vue'],
Expand Down

1 comment on commit a6086f4

@doraemonxxx
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dcbe551

Update docker packaging logic: The original fixed entry is to facilitate the replacement of environment variables, and in the nginx configuration, each time you get js and other resources, you don't need to use the cache. The problem is that the first opening will be very slow.
Therefore, the solution used this time is to return to the original hash+timestamp entry file name of vben, but use fuzzy matching when replacing environment variables.

@xachary

Why were the timestamp and hash removed? The commit message in the revision dcbe551 mentions that keeping the timestamp and hash would enhance the app's loading speed during the initial opening or load.

Please sign in to comment.