Skip to content

Commit

Permalink
fix(ssr): generate same asset url links for ssr build
Browse files Browse the repository at this point in the history
fix #1711
  • Loading branch information
yyx990803 committed Jan 25, 2021
1 parent cbeb9ba commit 68960f7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Binary file added packages/playground/ssr/src/assets/asset.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/playground/ssr/src/vue/Async.vue
@@ -1,5 +1,6 @@
<template>
<h1>{{ msg }}</h1>
<img src="../assets/asset.png">
</template>

<script setup>
Expand Down
14 changes: 6 additions & 8 deletions packages/vite/src/node/build.ts
Expand Up @@ -349,14 +349,12 @@ async function doBuild(
: libOptions
? `${pkgName}.${output.format || `es`}.js`
: path.posix.join(options.assetsDir, `[name].[hash].js`),
chunkFileNames:
libOptions || ssr
? `[name].js`
: path.posix.join(options.assetsDir, `[name].[hash].js`),
assetFileNames:
libOptions || ssr
? `[name].[ext]`
: path.posix.join(options.assetsDir, `[name].[hash].[ext]`),
chunkFileNames: libOptions
? `[name].js`
: path.posix.join(options.assetsDir, `[name].[hash].js`),
assetFileNames: libOptions
? `[name].[ext]`
: path.posix.join(options.assetsDir, `[name].[hash].[ext]`),
// #764 add `Symbol.toStringTag` when build es module into cjs chunk
// #1048 add `Symbol.toStringTag` for module default export
namespaceToStringTag: true,
Expand Down

0 comments on commit 68960f7

Please sign in to comment.