The line causing the problems can be found here: https://github.com/rawilk/vue-laravel/blob/master/src/js/utils/class/ajax.js#L81
laravel-mix compilation error from importing a class from node module
I have a utility class from an npm package I made that I am trying to import into a script I have in Laravel. It makes use of object rest spread (...), and because of that, I am receiving the unexpected token error telling me that I need the appropriate loader. I do have the babel-plugin-transform-object-rest-spread package installed, as well as a .babelrc file created to include it as a plugin, but I still receive the error.
What I find interesting is that if I make an exact copy of the class in my Laravel project and import that file, it compiles just fine. It only seems to fail when I try importing it from node_modules.
The class I'm trying to import can be found here: https://github.com/rawilk/vue-laravel/blob/master/src/js/utils/class/ajax.js
This is how I'm importing it:
// Importing this results in a compilation error
import Ajax from 'vue-laravel/src/js/utils/class/ajax';
// the local class version of this works when imported
// import Ajax from './test';
Please or to participate in this conversation.