-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Autoprefixer is only active for .vue files #600
Comments
Possible duplicate of: #544 |
Got this problem as well. Importing any SCSS file, though loads them correctly, does not autoprefix them. But above solution by @cycold works like a charm, thank you! |
Yes the solution from @cycold works great. However you get a warning pointing to https://github.com/postcss/postcss-loader#sourcemap if you have Would be nice if this feature came out of the box as it's kinda expected result. |
EDIT: my code is not correct. |
Any further developments to this? I have to suppport IE10.... :( |
@KagamiChan Your code seems incorrect. @cycold is right. From
|
@gluons agreed, you're right, edited my code |
@cycold I tried the solution but did not work anyone can help? tks |
I ran <!-- src/App.vue -->
<style>
@import './assets/test1.css';
.test1b { display: flex; }
</style>
<style lang="scss">
@import './assets/test2.scss';
.test2b { display: flex; }
</style> Result: .test1{
display:flex
}
.test1b,
.test2,
.test2b{
display:-webkit-box;
display:-ms-flexbox;
display:flex
} This is an issue for using 3rd party Vue components which import plain css. |
Hm, that's weird. Postcss is active for |
Does `vue-cli` cache the webpack template, or check for the latest every time?
How do I actually check the version/changeset of the template I installed?
… On 14 Nov 2017, at 6:39 pm, Thorsten Lünborg ***@***.***> wrote:
Hm, that's weird. Postcss is active for .css files since yesterday, so airport fixer should be applied. I will check this out.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#600 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAS8wEt0ZCuhcFmGU6hetmYMyh6GRw-tks5s2UOqgaJpZM4MeO72>.
|
We didn't properly version for the longest time, but recently started adding a version number to the top of |
Ah then it is broken in v1.2.1 |
I have a suspicion, but can't verify until tonight. However I already made a PR that aims to solve this or something related. https://github.com/vuejs-templates/webpack/pull/1053/files You might try to give this a spin. The PR itself is also not thoroughly tested et (it's WIP), but maybe it just works :-P |
Yes that fixes it! Discussion of |
Thanks. Will apply that PR tonight hopefully. |
@ozguruysal and @tfsimondouglas, I was getting the same sourcemap warning. Building on @cycold's solution, you can get the warning to go away by adding the var postcssLoader = {
loader: 'postcss-loader',
options: {
sourceMap: options.sourceMap
}
} |
Additionally there is this PR for vue-loader that solves the use of |
fixed by adding postcss-loader for all *.*css files as well. |
I'm using an old version of the template that has this issue and it seemed really peculiar, because I noticed CSS within an SFC |
const postcssLoader = { // generate loader string to be used with extract text plugin eg: my code did not work, help tks! |
this code maybe had other problem , i not kook at |
This seems to be the same bug as #85, which was closed because, I quote, "Autoprefixer is in the latest template release", but we don't get Autoprefixer working for CSS or SCSS files outside of
.vue
components.Steps to reproduce:
Then create a few test stylesheets:
Finally, let's test a few ways to load these:
Then
npm run build
. Results:(Remove the entry points test before.) Then
npm run build
. Result:Result:
Conclusion: Autoprefixer is only used for style tags inside
.vue
components.When using Sass or SCSS syntax and an external Sass/SCSS stylesheet, this can be used to apply Autoprefixer to code stored outside of components; the same trick does not work for CSS imports.
Was #85 closed based on a faulty assumption?
As a side note, debugging this issue proved difficult (for several team members) because this template comes with references to autoprefixer and postcss in two locations:
package.json
->"browserslist"
entry.postcssrc.js
But the config in
config
andbuild
never references these locations, postcss or autoprefixer. It's all happening by magic, but only in very limited settings.Maybe the brower list and postcss config should be moved to
build/vue-loader.conf.js
, if it only applies to vue-loader? As it is, it's sending the message that it's a project-wide config, but in practice it doesn't seem to be.The text was updated successfully, but these errors were encountered: