Skip to content

cssnext examples don't work #23

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
taion opened this issue Aug 20, 2015 · 14 comments
Closed

cssnext examples don't work #23

taion opened this issue Aug 20, 2015 · 14 comments

Comments

@taion
Copy link
Contributor

taion commented Aug 20, 2015

I was trying to use this loader to use cssnext and autoprefixer. The examples seem not to work with the latest versions - I found that I had to use cssnext() instead of just cssnext to get cssnext to run.

@ai
Copy link
Contributor

ai commented Aug 20, 2015

What version of loader and cssnext you used before and update before this issue?

@taion
Copy link
Contributor Author

taion commented Aug 20, 2015

postcss-loader@0.6.0 and cssnext@1.8.3. I was setting this up from scratch - didn't have this working at any point. I could just be doing something wrong though.

@ai
Copy link
Contributor

ai commented Aug 20, 2015

@taion can you help me (I am on the way and can do research myself). Do you update cssnext too? Can you reduce cssnext back and update only postcss-loader?

@taion
Copy link
Contributor Author

taion commented Aug 20, 2015

Oh, I see that this example just got added. I think there's just a slight typo there. Instead of:

    postcss: function () {
        return [autoprefixer, cssnext];
    }

it should be

    postcss: function () {
        return [autoprefixer, cssnext()];
    }

BTW, I'm unclear as to when it's better to use postcss-loader with the cssnext plugin v just using cssnext-loader. Could it be worth explaining that?

@ai
Copy link
Contributor

ai commented Aug 20, 2015

@taion technically, cssnext should works wihout (). Do I right @MoOx ?

@ai
Copy link
Contributor

ai commented Aug 20, 2015

@taion the most easy way is a cssnext-loader. But PostCSS has many awesome plugin, so I didn’t see a reason why you should use only Autoprefixer and cssnext :D. For example, font-magician.

@taion
Copy link
Contributor Author

taion commented Aug 20, 2015

This is far beyond anything I know, but it looks like cssnext exports a function that returns a plugin, rather than directly exporting a plugin: https://github.com/cssnext/cssnext/blob/1.8.3/src/index.js#L20

@ai
Copy link
Contributor

ai commented Aug 20, 2015

Seems like. OK, so it is not a problem of PostCSS 5.0 (we made so many changes there :D ).

@taion
Copy link
Contributor Author

taion commented Aug 20, 2015

Although this example is a little weird if you think about it, since cssnext already includes autoprefixer if I'm not mistaken.

@ai
Copy link
Contributor

ai commented Aug 20, 2015

@taion yeap, I will change example

@ai
Copy link
Contributor

ai commented Aug 20, 2015

Done 246c90f

@MoOx
Copy link
Contributor

MoOx commented Aug 20, 2015 via email

@taion
Copy link
Contributor Author

taion commented Aug 20, 2015

@ai @MoOx Oof. That only makes it more confusing as to whether I should use postcss-loader or cssnext-loader.

@MoOx
Copy link
Contributor

MoOx commented Aug 20, 2015

This will be more clear in cssnext 2.x when cssnext will deprecate all cssnext runners in favors of postcss ones.

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

3 participants