twg_'s avatar
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.

  1. site.js - compiles fine by itself
  2. slider.js - compiles fine by itself as well.
  3. 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.

0 likes
0 replies

Please or to participate in this conversation.