Skip to content

postcss import need works with postcss url #1106

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

Closed
SirM2z opened this issue Nov 24, 2017 · 4 comments
Closed

postcss import need works with postcss url #1106

SirM2z opened this issue Nov 24, 2017 · 4 comments

Comments

@SirM2z
Copy link
Contributor

SirM2z commented Nov 24, 2017

Hi, I got error in last release

my css:

@font-face {
  font-family: "iconfont";
  src: url('iconfont.eot?t=1510823274364'); /* IE9*/
  /* ... */
}

it is solved when I add "postcss-url": {}, in .postcssrc.js

@LinusBorg
Copy link
Contributor

LinusBorg commented Nov 25, 2017

Please provide way to reproduce this for us, I can't tell what you did to get this error.

For starters: Where is this font file saved, relative to the .vue file?

@SirM2z
Copy link
Contributor Author

SirM2z commented Nov 27, 2017

My directory

 .
└── src
   ├── App.vue
   └── assets
      └── font
         ├── iconfont.css
         └── iconfont.eot

In App.vue

@import './assets/font/iconfont.css';

In iconfont.css

@font-face {
  font-family: "iconfont";
  src: url('iconfont.eot?t=1510823274364'); /* IE9*/
  /* ... */
}

I do not know exactly what caused it, but it was solved when I added "postcss-url": {} in .postcssrc.js

like this:

In .postcssrc.js

module.exports = {
  "plugins": {
    // to edit target browsers: use "browserslist" field in package.json
    "postcss-import": {},
    "postcss-url": {},
    "autoprefixer": {}
  }
}

@LinusBorg
Copy link
Contributor

Thanks. It seems that makes sense indeed. If someone wants to do a PR:

  1. extend .postcssrc.js like OP showed
  2. add postcss-url to package.json. Becarefulö not to put it inside a conditional block

@LinusBorg
Copy link
Contributor

That's included now

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

No branches or pull requests

2 participants