Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 导入图标字体文件时出错_Css_Webpack_Vue.js_Stylus - Fatal编程技术网

Css 导入图标字体文件时出错

Css 导入图标字体文件时出错,css,webpack,vue.js,stylus,Css,Webpack,Vue.js,Stylus,在我的项目中,我想使用图标字体。 这是icon.styl的一些内容: @font-face { font-family: 'sell-icon'; src: url('../fonts/sell-icon.eot?o23a15'); src: url('../fonts/sell-icon.eot?o23a15#iefix') format('embedded-opentype'), url('../fonts/sell-icon.ttf?o23a15') format('

在我的项目中,我想使用图标字体。 这是icon.styl的一些内容:

@font-face {
 font-family: 'sell-icon';
 src:  url('../fonts/sell-icon.eot?o23a15');
 src:  url('../fonts/sell-icon.eot?o23a15#iefix') format('embedded-opentype'),
      url('../fonts/sell-icon.ttf?o23a15') format('truetype'),
      url('../fonts/sell-icon.woff?o23a15') format('woff'),
      url('../fonts/sell-icon.svg?o23a15#sell-icon') format('svg');
      font-weight: normal;
      font-style: normal;
 }
但不幸的是,我在编译时出现了4个错误:

 ERROR  Failed to compile with 4 errors                                                        
 11:22:32

 These relative modules were not found:

* ../fonts/sell-icon.eot?o23a15 in ./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-12835cef","scoped":false,"hasInlineConfig":false}!./node_modules/stylus-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/header/header.vue
* ../fonts/sell-icon.svg?o23a15 in ./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-12835cef","scoped":false,"hasInlineConfig":false}!./node_modules/stylus-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/header/header.vue
* ../fonts/sell-icon.ttf?o23a15 in ./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-12835cef","scoped":false,"hasInlineConfig":false}!./node_modules/stylus-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/header/header.vue
* ../fonts/sell-icon.woff?o23a15 in ./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-12835cef","scoped":false,"hasInlineConfig":false}!./node_modules/stylus-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/header/header.vue  
我已经安装了手写笔加载程序和css加载程序:

npm install stylus stylus-loader --save-dev
npm install stylus css-loader --save-dev
字体和手写笔位于同一目录中。sell icon.*的文件位于fonts目录中。icon.styl位于手写笔目录中


谁能帮我?

试着从路径中删除
。/
。@KoshVery,我已经测试过从路径中删除../了。它失败了again@KoshVery,我用绝对路径解决了这个问题