Support the ongoing development of Laravel.io →
Views Packages
Last updated 2 weeks ago.
0

I don't think this is completely impossible, it's overall JavaScript, why now? :D

But do notice that node.js is a runtime environment that uses JavaScript as its language. There are certainly packages using its core modules, and I bet it's going to be hard as some of the packages are targeting only to node environment.

Some of the packages such as jQuery, moment.js are capable working on both client and server version, some even provide 2 different versions, one for client, one for server, so you can definitely do npm install jquery and include them from your node_modules folder like how you would normally include your script.

You could also take a look at these,

PS: If they have a client-side, it could also be available on Bower, the "client-side" npm.

PS2: If you would like to "require" libraries like you do on node, you could try to use AMD RequireJS as well. It provides similar syntax as CommonJS

Last updated 7 years ago.
0

if you're using npm packages on views better switch to bower because npm is not made for inclusion on views. It will work on some but some packages will not work like that.

Last updated 7 years ago.
0

so i have to use bower and install extra js libraries like require etc?

i will have a look on bower website. thanks!

0

Sign in to participate in this thread!

LoadForge

Your banner here too?

avieln avieln avieln Joined 29 Jan 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.