Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

想问一下为什么import css文件后为什么会说找不到 #47

Closed
z1047549075 opened this issue Nov 22, 2017 · 8 comments
Closed

Comments

@z1047549075
Copy link

These relative modules were not found:

  • ../font/fontello.eot?58619503 in ./node_modules/css-loader?{"sourceMap":false}
    !./node_modules/postcss-loader/lib?{"sourceMap":false}!./node_modules/vue-easyta
    ble/libs/themes-base/index.css
  • ../font/fontello.svg?58619503 in ./node_modules/css-loader?{"sourceMap":false}
    !./node_modules/postcss-loader/lib?{"sourceMap":false}!./node_modules/vue-easyta
    ble/libs/themes-base/index.css
  • ../font/fontello.ttf?58619503 in ./node_modules/css-loader?{"sourceMap":false}
    !./node_modules/postcss-loader/lib?{"sourceMap":false}!./node_modules/vue-easyta
    ble/libs/themes-base/index.css
  • ../font/fontello.woff2?58619503 in ./node_modules/css-loader?{"sourceMap":fals
    e}!./node_modules/postcss-loader/lib?{"sourceMap":false}!./node_modules/vue-easy
    table/libs/themes-base/index.css
  • ../font/fontello.woff?58619503 in ./node_modules/css-loader?{"sourceMap":false
    }!./node_modules/postcss-loader/lib?{"sourceMap":false}!./node_modules/vue-easyt
    able/libs/themes-base/index.css
    就是报这些错误,找了很久没找到原因
@huangshuwei
Copy link
Collaborator

你用的哪个版本?

我这边用了版本是 1.5.8 测试 没问题。

看你的报错信息应该是‘字体’loader 沒找到,字体loader配置可以参考:

  {
            test: /\.(eot|woff|woff2|ttf|svg)(\?\S*)?$/,
            use: [{
                loader: 'url-loader',
                options: {
                    limit: 5000,
                    name: 'font/[name]-[hash:8].[ext]'
                }
            }]

        }

有问题再反馈

@z1047549075
Copy link
Author

我的也是1.5.8版本的,昨天又调试了很久没找到原因,应该是和vue-vli、node的版本有些关系,我换成是直接引用umd/css/index.css就可以了

@huangshuwei
Copy link
Collaborator

你的 webpack loader 配置发出来我看下

@z1047549075
Copy link
Author

image
采取的是vue-cli新建项目默认的loader

@huangshuwei
Copy link
Collaborator

@z1047549075
知道了,你少配置了一种字体格式:woff
你加上去应该就可以了

  {
            test: /\.(eot|woff|woff2|ttf|svg)(\?\S*)?$/,
            use: [{
                loader: 'url-loader',
                options: {
                    limit: 5000,
                    name: 'font/[name]-[hash:8].[ext]'
                }
            }]

        }

@z1047549075
Copy link
Author

不是呢,我现在重新换了你给的配置,还是不行
去掉import或者是缓存是umd/css/index.css就可以,真不知道是哪里的问题

@huangshuwei
Copy link
Collaborator

woff 类型字体是必须配置的,因为table组件依赖这个字体。

配置改完以后,需要重新执行webpack 命令,你在重新打包试试

@huangshuwei
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants