Repository navigation
Backend integration : can't find assets #23817
|
Hello, export default defineConfig({
input: {
'entry-js': '/src/assets/entry-js.ts',
},The doc seems to imply that we can insert the assets inside a html or a tempate file using relative url : <script type='module' src='http://localhost:5173/entry-js.ts'></script>It doesn't work, instead, I must put the <script type='module' src='http://localhost:5173/src/assets/entry-js.ts'></script>Is this normal ? Thanks for you help |
Replies: 2 comments 1 reply
|
yes, that's normal. in dev, the url follows the file's path from vite's the docs use |
|
Hi @WaningJupiter! Yes, this behavior is completely normal. Here is why and how the backend integration pattern works: Why
|
yes, that's normal. in dev, the url follows the file's path from vite's
root, so yours is/src/assets/entry-js.tsthe docs use
/main.jsbecause that file is at the project root. theentry-jskey ininputnames the build entry, but doesn't create/entry-js.tsin dev