Jul 14, 2021
0
Level 1
Laravel mix import node module in project
I'm trying to import a node module in a custom module i'm creating in public folder.
What i'm doing in webpack.mix.js
mix.js('resources/js/app.js', 'public/js')
.vue()
.sass('resources/sass/app.scss', 'public/css')
.js('node_modules/normalize-wheel', 'public/assets')
.version();
In script file
import NormalizeWheel from '../normalize-wheel.js'
the error i'm getting
Uncaught SyntaxError: The requested module '../normalize-wheel.js' does not provide an export named 'default'
How can i import from node_modules folder correctly with laravel mix?
Please or to participate in this conversation.