webpack less error, it can't resolve .ttf and woff2 files from uikit

后端 未结 1 1726
情话喂你
情话喂你 2021-01-04 09:22

I\'m really newbie with webpack, so I\'m not sure if I\'m doing something wrong, I wish use uikit and less with webpack, I\'ve installed the respective loaders like url-load

相关标签:
1条回答
  • 2021-01-04 09:56

    I recommend you to write loaders in a short way

    webpack.config.js

    loaders: [
    ... other loaders
    {
        test: /\.(eot|woff|woff2|ttf|svg|png|jpg)$/,
        loader: 'url-loader?limit=30000&name=[name]-[hash].[ext]'
    }
    

    Don't forget

    npm install url-loader --save-dev
    

    And checkout variable @icon-font-path it should be

    /bower_components/uikit/less/core/icon.less

    "../../fonts";
    
    0 讨论(0)
提交回复
热议问题