简体   繁体   English

如何在我的 Laravel 7 项目中导入 npm 包

[英]how to import npm package in my laravel 7 project

Where i can import this code我可以在哪里导入此代码

const mykad = require('mykad') const mykad = require('mykad')

from this package in to my laravel 7 project.这个包到我的laravel 7项目。 and how to code in blade in input form.以及如何以输入形式在刀片中编码。

You can include JS file from node_modules to your app by requiring them at your resource level app.js您可以通过在资源级别 app.js 要求它们来将 node_modules 中的 JS 文件包含到您的应用程序中

path = app\\resources\\js\\app.js

like this:像这样:

const mykad = require('mykad')

and then run in terminal然后在终端中运行

npm run dev

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM