qirolab / laravel-themer

Multi theme support for Laravel application
https://qirolab.com
MIT License
372 stars 49 forks source link

Error: Cannot find module 'theme'/webpack.mix.js #17

Closed aeq-dev closed 3 years ago

aeq-dev commented 3 years ago

hello, I have an issue when I run npm run dev --theme=xxx

(Laravel 8 latest)

Screenshot from 2021-10-16 12-54-13

aeq-dev commented 3 years ago

and here my global webpack.mix.js in project root :


const mix = require('laravel-mix');

 let theme = process.env.npm_config_theme;

 if(theme) {
    require(`${__dirname}/themes/${theme}/webpack.mix.js`);
 } else {
     // default theme to compile if theme is not specified
   require(`${__dirname}/themes/vuexy/webpack.mix.js`);
 }

Please note that the file webpack exists in vuexy themes folder, And also the command npm run dev works fine