Vue.js 模块分析失败:意外字符'';(1:0)
当我遵循以下步骤时: 在myVue.js 模块分析失败:意外字符'';(1:0),vue.js,iview,Vue.js,Iview,当我遵循以下步骤时: 在mymain.js中 在这里,我得到了以下输出错误: client?7705:167 ./node_modules/iview/dist/styles/fonts/ionicons.eot?v=2.0.0 Module parse failed: Unexpected character '�' (1:0) You may need an appropriate loader to handle this file type. (Source code omitted f
main.js
中
在这里,我得到了以下输出错误:
client?7705:167 ./node_modules/iview/dist/styles/fonts/ionicons.eot?v=2.0.0
Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
@ ./node_modules/css-loader!./node_modules/iview/dist/styles/iview.css 7:4430-4469 7:4495-4534
@ ./node_modules/iview/dist/styles/iview.css
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://0.0.0.0:8081 webpack/hot/dev-server ./src/main.js
在我的webpack.config.js
中:
module: {
loaders: [
// the url-loader uses DataUrls.
// the file-loader emits files.
{ test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader?limit=10000&mimetype=application/font-woff" },
{ test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader" },
{ test: /\.json$/, loader: "json" },
{test: /\.less$/, loader: "style!css!less"},
{test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=application/font-woff'},
{test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file'},
{test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=image/svg+xml'}
]
},
...
我不知道我的加载器还应该配置什么。
如果我不导入iview.css
:
//import 'iview/dist/styles/iview.css'
没有此问题。请尝试使用如下url加载程序:
{ test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' }
对于更一般的用例,请添加后缀:
{
test: /\.(jpe?g|png|woff|woff2|eot|ttf|svg)(\?[a-z0-9=.]+)?$/,
loader: 'url-loader?limit=100000'
}
试试这个:
test: /\.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
或者为您的问题模块设置一个绝对路径。我会尝试删除并重新下载iview。@acdcjunior我已尝试重新安装iview。您是否停止并重新启动了服务器?再次尝试使用
npm安装
。您可以在链接中查找其他解决方案。看看最后一个。我的意思是看我链接的源代码。
test: /\.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,