Skip to content

Commit

Permalink
fix: πŸ› add rel=#79 - File changes hash based name enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
renoirb committed Oct 30, 2024
1 parent 84d1e8f commit b371799
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,16 @@ const main: NuxtConfig = {
// No need to cache for eternity, under heavy traffic, it's OK
// Same file served from browser cache not too long.
filenames: {
app: () => '[name].js',
chunk: () => '[name].js',
// rel=#79
// https://github.com/renoirb/site/issues/79
app: ({ isDev, isModern }) =>
isDev
? `[name]${isModern ? '.modern' : ''}.js`
: `[contenthash:7]${isModern ? '.modern' : ''}.js`,
chunk: ({ isDev, isModern }) =>
isDev
? `[name]${isModern ? '.modern' : ''}.js`
: `[contenthash:7]${isModern ? '.modern' : ''}.js`,
css: () => '[name].css',
img: () => '[path][name].[ext]',
font: () => '[path][name].[ext]',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "renoirboulanger.com",
"version": "4.0.0-dev",
"version": "4.0.1-dev",
"private": true,
"description": "Renoir Boulanger βœͺ Expert in Front-End Ops, UI Libraries who cares about Accessibility",
"keywords": [
Expand Down

0 comments on commit b371799

Please sign in to comment.