[Vuejs]-Failed to compile error when trying to use theme in my Vue project using iView

0👍

You need to enable javascript loaderOptions in vue.config.js

If you don’t have vue.config.js file in the root folder of your project, let’s create this file and paste the below code:

module.exports = {
    css: {
        loaderOptions: {
            less: {
                javascriptEnabled: true
            }
        }
    }
};

Otherwise, you just put this code to vue.config.js file. Your file now looks likes this:

module.exports = {
    ...// other options
    ...
    css: {
        loaderOptions: {
            less: {
                javascriptEnabled: true
            }
        }
    }
    ...
    ...
};

Leave a comment