Dec 18, 2019
0
Level 6
Error when mixing JS
I have 3 JS files in my project. When I try to mix them into a single js file, I get undefined.
- site.js - compiles fine by itself
- slider.js - compiles fine by itself as well.
- lightbox.js - will not compile.
site.js contents
import Lightbox from './components/lightbox'
import { slider_plugin } from './components/slider'
..... other simple inline js
slider.js contents (condensed)
function slider_plugin() { ... }
export default { slider_plugin }
lightbox.js contents (condensed)
import '../../../node_modules/swipe/swipejs/swipe'
export default Lightbox { ... }
Whenever I run npm run production I get a file with just undefined inside it.
Also, I'm using laravel mix outside of laravel.
Please or to participate in this conversation.