Skip to content

Private plugin with ES Module: any example? #1969

Answered by ai
pierreberchtold asked this question in Q&A
Discussion options

You must be logged in to vote

You need to define relative path (with file extension) if you use custom plugin:

export default {
  plugins: {
    'postcss-import': {},
    'tailwindcss/nesting': {},
    tailwindcss: {},
    autoprefixer: {},
   './postcss/tailwind-important-last.js': {}
  },
}

I am not sure, that Vite supports loading ESM plugins right now (since Vite is using CommonJS). Maybe you will need to define plugin in CommonJS and save as ./postcss/tailwind-important-last.cjs (and use .cjs in postcss.config.js.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pierreberchtold
Comment options

Answer selected by pierreberchtold
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants