mrTimofey / vue-ssr-starter

Starter kit for projects with Webpack 4, Vue 2 and SSR
53 stars 15 forks source link

how to create route for CSS and JS in assets #5

Closed farhad-arjmand closed 5 years ago

mrTimofey commented 5 years ago

You don't need routes for CSS and JS files. You definitely do something wrong or I just don't understand what do you really want to achieve.

farhad-arjmand commented 5 years ago

i want to link css file to layout or i want to link image to img tag , icant find correct path

mrTimofey commented 5 years ago

CSS is handled automatically, you don't have to do anything manually. To link image just place it in the assets/i directory and require/import it anywhere you want. To import image from template directly use something like img(src="~assets/i/image.jpg") and Webpack will resolve it.

farhad-arjmand commented 5 years ago

thanks

farhad-arjmand commented 5 years ago

i want to link icon to meta tags , but not found link(rel='mask-icon', href='~assets/icons/safari-pinned-tab.svg', color='#5bbad5')

or

link(rel='mask-icon', href='/assets/icons/safari-pinned-tab.svg', color='#5bbad5')

Page not found :(

mrTimofey commented 5 years ago

Read this

But I advise you to learn some basic stuff before going deeper into Vue and SSR. Try to use something like Nuxt or Ream which are well documented and have community. My vue-ssr-starter is for those who want to make all the things from scratch and that is definitely not what you should do now IMHO.