Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix]: update nuxt config: remove hash from file names #404

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions resources/newssite/news-nuxt/dist/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<head><meta charset="utf-8">
<title>The Daily Broadcast</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="A news site developed with Nuxt."><link rel="modulepreload" as="script" crossorigin href="./_nuxt/entry.6023314e.js"><link rel="preload" as="style" href="./_nuxt/entry.4163a698.css"><link rel="prefetch" as="script" crossorigin href="./_nuxt/error-component.df420153.js"><link rel="stylesheet" href="./_nuxt/entry.4163a698.css"></head>
<body ><div id="__nuxt"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"./",buildAssetsDir:"/_nuxt/",cdnURL:"./"}}</script><script type="module" src="./_nuxt/entry.6023314e.js" crossorigin></script></body>
<meta name="description" content="A news site developed with Nuxt."><link rel="modulepreload" as="script" crossorigin href="./_nuxt/entry.js"><link rel="preload" as="style" href="./_nuxt/entry.css"><link rel="prefetch" as="script" crossorigin href="./_nuxt/error-component.js"><link rel="stylesheet" href="./_nuxt/entry.css"></head>
<body ><div id="__nuxt"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"./",buildAssetsDir:"/_nuxt/",cdnURL:"./"}}</script><script type="module" src="./_nuxt/entry.js" crossorigin></script></body>
</html>

Large diffs are not rendered by default.

This file was deleted.

1 change: 1 addition & 0 deletions resources/newssite/news-nuxt/dist/_nuxt/error-404.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

1 change: 1 addition & 0 deletions resources/newssite/news-nuxt/dist/_nuxt/error-500.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

3 changes: 3 additions & 0 deletions resources/newssite/news-nuxt/dist/_nuxt/error-component.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions resources/newssite/news-nuxt/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<head><meta charset="utf-8">
<title>The Daily Broadcast</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="A news site developed with Nuxt."><link rel="modulepreload" as="script" crossorigin href="./_nuxt/entry.6023314e.js"><link rel="preload" as="style" href="./_nuxt/entry.4163a698.css"><link rel="prefetch" as="script" crossorigin href="./_nuxt/error-component.df420153.js"><link rel="stylesheet" href="./_nuxt/entry.4163a698.css"></head>
<body ><div id="__nuxt"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"./",buildAssetsDir:"/_nuxt/",cdnURL:"./"}}</script><script type="module" src="./_nuxt/entry.6023314e.js" crossorigin></script></body>
<meta name="description" content="A news site developed with Nuxt."><link rel="modulepreload" as="script" crossorigin href="./_nuxt/entry.js"><link rel="preload" as="style" href="./_nuxt/entry.css"><link rel="prefetch" as="script" crossorigin href="./_nuxt/error-component.js"><link rel="stylesheet" href="./_nuxt/entry.css"></head>
<body ><div id="__nuxt"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"./",buildAssetsDir:"/_nuxt/",cdnURL:"./"}}</script><script type="module" src="./_nuxt/entry.js" crossorigin></script></body>
</html>
11 changes: 11 additions & 0 deletions resources/newssite/news-nuxt/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,15 @@ export default defineNuxtConfig({
cdnURL: "./",
baseURL: "./",
},
vite: {
build: {
rollupOptions: {
output: {
chunkFileNames: "_nuxt/[name].js",
entryFileNames: "_nuxt/[name].js",
assetFileNames: "_nuxt/[name].[ext]",
Comment on lines +46 to +48
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not convinced: if we do that, when we'll update the file, the old version might be served from the cache. This will lead to bugs and frustrations.

I think the hash changing is a symptom that the content changes. I'm not too concerned about the hash change, it is easy to review. I'm more concerned to know why the content changes.
That's not a super big deal. Though I wonder if removing the minify step would be acceptable, as this would make easier to review the rendered code. Set this to false in vite's configuration, though it looks like there's an option in nuxt too.
What do you think?

},
},
},
},
});
Loading