Error with 'import' statement without .js extension using npm module with Laravel Mix
问题 I'm using CKEditor 5 in a Laravel project, getting it from a CDN, so initially I have not needed to run npm. But now I need an alignment plugin, so I used Laravel Mix to run npm install, and then copy the plugin to public folder. Like this: mix.copyDirectory('node_modules/@ckeditor', 'public/@ckeditor'); In my code, I tried to import it: import Alignment from '/@ckeditor/ckeditor5-alignment/src/alignment.js'; So it threw this error in console Uncaught TypeError: Failed to resolve module