Z
Z
Zhandos Timabay2019-11-05 12:11:26
npm
Zhandos Timabay, 2019-11-05 12:11:26

How to use js libraries installed via composer npm packages?

I installed packages for vue via composer npm, but I don’t know how to connect them in the view and start using them.
Or is it better to compile as a separate vue application with webpack and with all the charms and then just compile it as a separate js file?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2019-11-05
@jake47

If we start from the ideal, then yes. Composer for php npm for js packages. But in composer, you can also connect asset libraries separately.
For example;

"bower-asset/font-awesome": "^4.7",
        "bower-asset/owl.carousel": "^2.2",
        "bower-asset/magnific-popup": "^1.1",

If you use vue fully, then even the documentation recommends installing it via npm. So separate the two applications. Server scripts in php will only work as api, and the entire UI will be in vue.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question