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

autoprefixer只能用于通过vue-loader解析的样式 #544

Closed
zWingz opened this issue Feb 22, 2017 · 9 comments
Closed

autoprefixer只能用于通过vue-loader解析的样式 #544

zWingz opened this issue Feb 22, 2017 · 9 comments

Comments

@zWingz
Copy link

zWingz commented Feb 22, 2017

image
我暂时的做法是
添加postcss-loader,
并在根目录创建postcss.config.js

module.exports = {
    plugins: [
        require('autoprefixer')({ browsers: ['last 5 versions', 'Android >= 2.0'] })
    ]
}
@cccRaim
Copy link

cccRaim commented Mar 12, 2017

以前是数组然后map每个loader的,如['style', 'css'],可是不知道哪个版本开始就只能一个字符串了。

@cycold
Copy link

cycold commented Mar 17, 2017

我也是碰到了这个问题 在单独的.scss文件中 autoprefix没有起作用

@anchengjian
Copy link

我的方法是在 app.vue 中引入公共 css

...

<style src="./assets/css/style.css"></style>
<style>
  .full-container {
    width: 100%;
    height: 100%;
  }
</style>

@shalldie
Copy link

你太棒了,,,总算让我找到个可以解决的方式

@yoyo837
Copy link

yoyo837 commented May 31, 2017

@zWingz 你添加上去后,没有收到PostCSS Loader的警告吗?

Previous source map found, but options.sourceMap isn't set. In this case the loader will discard the source map enterily for performance reasons.

@BelinChung
Copy link
Contributor

@yoyo837

var postcssLoader = {
    loader: 'postcss-loader',
    options: {
      sourceMap: true
    }
  }

@yoyo837
Copy link

yoyo837 commented Jun 1, 2017

@BelinChung

var postcssLoader = {
    loader: 'postcss-loader',
    options: {
      sourceMap: true
    }
  }

The same warning...

look at this
commit:
webpack-contrib/postcss-loader@159b66a

issues:
webpack-contrib/postcss-loader#248

I switch to a low version postcss-loader@1.3.3

@SallyOne
Copy link

上述两个问题都碰到了

@flyher
Copy link

flyher commented Jun 20, 2017

@yoyo837
Thank you.
I change the version to postcss-loader@1.3.3, the warning disappeared.

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

10 participants