I have created a Vue project with Typescript having components in class style. I need to include some external CSS file - like from Amazon S3. The CSS doesn't seems to be loaded.
In the network section I can see it.
you can load external URL
<style lang="scss or less">
@import "https://external_url_.css";
@import ".../assest/_.css";
</style>
you can load css loaders installed if you more such as sass-loader, css-loader , less-loader npm
"css-loader": "^3.2.0", Do I need to configure anywhere.I suggest you to use preprocessor
Install SASS -
npm install -D sass-loader sass
then You will be able to import it in your App.vue
<style lang="scss">
@import './static/css/style.css';
</style>
Update
I figured out one more way to include single css file.
In your App.vue, you can add css file to style src
<style src="relative-path/style.css"></style>
dynamic imports requires scss. This way you can even control individual css imports to single component too. There is JS way too using webpack but I recommend SASS here neat and helpful. In future you probably want to use scss<style lang="scss"> @import url('<some_url>'); </style>
vue-clior ?<link rel="stylesheet" href="">in index.html Updated my question