How to include script located in node_modules folder using codeigniter 4? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: How to include script located in node_modules folder using codeigniter 4? (/showthread.php?tid=79268) |
How to include script located in node_modules folder using codeigniter 4? - sfarzoso - 05-20-2021 I need to install this plugin on my application, so I followed the instruction and executed: PHP Code: npm install --save @ckeditor/ckeditor5-upload Usually, to load a plugin I create a file inside the `load` directory which contains the plugin name, in particular: PHP Code: Views which contains this: PHP Code: <!-- Push section js --> so to include in a specific section of my app, I simply do: PHP Code: <?= $this->include('App\Views\Backend\load\ckeditor') ?> and this will inject the plugin into my app, but how can I do this with local dependencies installed via npm? RE: How to include script located in node_modules folder using codeigniter 4? - InsiteFX - 05-20-2021 If you look on that page the last code sample is for 2 editors but it is showing all the html code. RE: How to include script located in node_modules folder using codeigniter 4? - sfarzoso - 05-20-2021 (05-20-2021, 02:41 AM)InsiteFX Wrote: If you look on that page the last code sample is for 2 editors but it is showing all the html code. But I cannot use import since is not a module, am I missing something?? RE: How to include script located in node_modules folder using codeigniter 4? - craig - 05-20-2021 You will need to use a build process to build/copy files you need from node_modules into public/assets/ (or whatever your assets folder is called). E.g. Webpack, Laravel Mix, Parcel, Rollup, Gulp. There are so many. |