gwleuverink's avatar

mix not compiling as expected

Hi! I have an issue with mix that I can't seem to fix.

I have a file in which I require several node modules and init a vue root component

routes.js

window.Vue = require('vue');
window._ = require('lodash');
window.axios = require('axios');

const root = new Vue({
    el: '#root'
});

In my mix file I define where the file should be compiled like so:

mix.js('resources/assets/js/routes.js', 'public/assets/js');

Everything compiles without any errors using npm run devbut when I open the compiled file the contents are not compiled at all! It's like the file wasn't run trough webpack and just copied.

The weird thing is that I use several other components on different pages that do compile like they should. I'm at a loss what the problem might be for this specific instance, since the way the file is built up and the mix directive in webpack.mix.js is exactly the same.

Any help is greatly appreciated!

0 likes
1 reply
gwleuverink's avatar
gwleuverink
OP
Best Answer
Level 10

Nevermind! fixed it. There was an line in webpack.mix.js unrelated to this code that caused a conflict of some kind.

Please or to participate in this conversation.