Following code-splitting recommendations from Webpack and vue-router, I am lazy loading heavy pages in my routes using dynamic import as such:
const Login = () => import("../views/Login/Login.vue");
However if this login.vue page contains an import statement for a css, the style is not properly loaded.
<script>
import '@/assets/sass/my_login.scss'
...
If I remove the dynamic import of the Login.vue page in my routes such as
import Login from '../views/Login/Login.vue'
The css is correctly loaded.
I want to load this Vue page asyncly by using dynamic import and I don't want to make this css global as it is only needed by this specific page.
How am I loading properly this css? Is there some magic syntax to be used in the Login.vue page or in the routes?
Thank your for your help
S.