解决Vue项目中tff报错的问题
编程学习 2021-07-04 14:06www.dzhlxh.cn编程入门
这篇文章主要介绍了解决Vue项目中tff报错的问题,具有很好的参考价值,希望对大家有所帮助。一起跟随长沙网络推广过来看看吧
在webpack.config.js中的模块配置中加如下的配置规则:
{test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, use: "url-loader"}
const path = require('path'); const htmlWebpackplugin = require('html-webpack-plugin'); const VueLoaderPlugin = require('vue-loader/lib/plugin'); module.exports = { entry: path.join(__dirname,'./src/main.js'), output: { path: path.join(__dirname, './dist'), filename: 'bundle.js' }, plugins: [ new htmlWebpackplugin({ //创建一个在内存中生成的html页面的插件 template: path.join(__dirname, './src/index.html'), filename: 'index.html' }), new VueLoaderPlugin() ], module: { //这个节点用于配置所有的第三方模块加载器 rules: [ {test: /\.css$/, use:['style-loader','css-loader']},//配置处理.css文件的第三方处理规则 {test: /\.less$/, use: ["style-loader",'css-loader','less-loader']}, {test: /\.scss$/, use: ["style-loader",'css-loader','sass-loader']}, {test: /\.(jpg|png|gif|bmp|jpeg)$/, use: "url-loader?limit=8000"}, {test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, use: "url-loader"}, {test:/\.js$/, use:'babel-loader',exclude:/node_modules