Skip to content

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

Closed
@zWingz

Description

@zWingz

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

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

Activity

cccRaim

cccRaim commented on Mar 12, 2017

@cccRaim

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

cycold

cycold commented on Mar 17, 2017

@cycold

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

anchengjian

anchengjian commented on Mar 17, 2017

@anchengjian

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

...

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

shalldie commented on Apr 25, 2017

@shalldie

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

yoyo837

yoyo837 commented on May 31, 2017

@yoyo837

@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

BelinChung commented on Jun 1, 2017

@BelinChung
Contributor

@yoyo837

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

yoyo837 commented on Jun 1, 2017

@yoyo837

@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

SallyOne commented on Jun 16, 2017

@SallyOne

上述两个问题都碰到了

flyher

flyher commented on Jun 20, 2017

@flyher

@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @LinusBorg@cycold@BelinChung@flyher@yoyo837

        Issue actions

          autoprefixer只能用于通过vue-loader解析的样式 · Issue #544 · vuejs-templates/webpack