Warm tip: This article is reproduced from stackoverflow.com, please click
vue.js vuepress

Vuepress custom theme and postcss

发布于 2020-05-03 06:53:08

I made a custom vuepress theme and published it on npm. Then I import it in a vuepress project, and the theme shows up.

The problem: the postcss plugins required by the theme are not processed.

The postcss plugins are in the dependencies of the theme's package.json and in the theme's index.js:

module.exports = {
    postcss: {
      plugins: [
        require('postcss-normalize'),
        require('postcss-preset-env')({
          stage: 0
        })
      ]
    }
  }

It does not work.

What is the correct way to register the postcss plugins in the vuepress theme?

Thank you

Questioner
François Romain
Viewed
30
François Romain 2020-02-14 19:59

according to this issue, it looks like a bug