[Vuejs]-Vue-cli + webpack: where to include npm package js and css files?

0👍

This seems to be working – in my main.js file, I’ve included the js and css files like this:

import Swiper from 'swiper'
import 'swiper/dist/css/swiper.min.css'

As far as I can tell, this is correctly importing the npm package into the project for use in development and production.

0👍

you can include these files in build/index.htmllike common js and css

<head> 
....
 <link rel="stylesheet" href="path_to_css/idangerous.swiper.css">
 <script defer src="path_to_js/idangerous.swiper-2.x.min.js"></script> 
.... 
</head>

Leave a comment