You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
709 B

3 years ago
  1. const path = require('path')
  2. module.exports = {
  3. parser: require('postcss-comment'),
  4. plugins: [
  5. require('postcss-import')({
  6. resolve(id, basedir, importOptions) {
  7. if (id.startsWith('~@/'))
  8. return path.resolve(process.env.UNI_INPUT_DIR, id.substr(3))
  9. else if (id.startsWith('@/'))
  10. return path.resolve(process.env.UNI_INPUT_DIR, id.substr(2))
  11. else if (id.startsWith('/') && !id.startsWith('//'))
  12. return path.resolve(process.env.UNI_INPUT_DIR, id.substr(1))
  13. return id
  14. }
  15. }),
  16. require('autoprefixer')({
  17. remove: process.env.UNI_PLATFORM !== 'h5'
  18. }),
  19. require('@dcloudio/vue-cli-plugin-uni/packages/postcss')
  20. ]
  21. }