-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Closed
Description
Version
3.2.1
Environment info
System:
OS: macOS 10.14.2
CPU: (8) x64 Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
Binaries:
Node: 9.11.2 - ~/.nvm/versions/node/v9.11.2/bin/node
Yarn: 1.5.1 - /usr/local/bin/yarn
npm: 6.5.0 - ~/.nvm/versions/node/v9.11.2/bin/npm
Browsers:
Chrome: 71.0.3578.98
Firefox: 63.0.3
Safari: 12.0.2
npmPackages:
@vue/babel-preset-app: 3.2.0
@vue/cli-overlay: 3.2.0
@vue/cli-plugin-babel: ^3.2.0 => 3.2.0
@vue/cli-plugin-pwa: ^3.2.0 => 3.2.0
@vue/cli-service: ^3.2.0 => 3.2.0
@vue/cli-shared-utils: 3.2.0
@vue/component-compiler-utils: 2.3.0
@vue/preload-webpack-plugin: 1.1.0
@vue/test-utils: ^1.0.0-beta.16 => 1.0.0-beta.26
@vue/web-component-wrapper: 1.2.0
babel-helper-vue-jsx-merge-props: 2.0.3
babel-plugin-transform-vue-jsx: 4.0.1
eslint-plugin-vue: ^5.0.0-0 => 5.0.0
vue: ^2.5.21 => 2.5.21 (2.5.18)
vue-eslint-parser: 4.0.3
vue-hot-reload-api: 2.3.1
vue-i18n: ^8.3.2 => 8.4.0
vue-lazyload: 1.2.3
vue-loader: 15.4.2
vue-router: ^3.0.1 => 3.0.2
vue-style-loader: 4.1.2
vue-template-compiler: ^2.5.21 => 2.5.21
vue-template-es2015-compiler: 1.6.0
vue2-better-scroll: ^1.0.7 => 1.0.7
vuex: ^3.0.1 => 3.0.1
npmGlobalPackages:
@vue/cli: 3.2.1
Steps to reproduce
- vue-cli 初始化一个项目
- 删除 package.json 中的 postcss 字段
- 按照官方文档( https://cli.vuejs.org/guide/css.html#postcss ),在 vue.config.js 中增加 postcss 相关的配置。
- postcss 的 autoprefix 没有按照预期生效
What is expected?
根据文档( https://cli.vuejs.org/guide/css.html#postcss )的描述,我应该可以在 vue.config.js 中配置 postcss 相关的配置
What is actually happening?
配置没有生效,追查代码发现判断逻辑有问题,只从 package.json 读取了 postcss 的配置
见:
const hasPostCSSConfig = !!(api.service.pkg.postcss || findExisting(api.resolve('.'), [ |