You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have vue application with Single-File Components where main.js is entry point and contains and js and css. And I want to load styles separately from JS
I have something like this:
// head
// Doing check because in development it still keep all CSS in JS. Otherwise it show 404 error because in vite dev mode main.css doesn't exist until it's build
<% if ENV["NODE_ENV"] == "production" %>
<%= vite_stylesheet_tag "main.css", media: "print", onload: "this.media='all'" %>
<% end %>
//body
<%= vite_javascript_tag "main.js", skip_style_tags: true, defer: true %>
It's woks fine but not sure if that is correct way.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have vue application with Single-File Components where main.js is entry point and contains and js and css. And I want to load styles separately from JS
I have something like this:
It's woks fine but not sure if that is correct way.
Beta Was this translation helpful? Give feedback.
All reactions