Skip to content

Uncaught Error : you might have mixed up default and named imports (tailwind.config.js) #1021

Discussion options

You must be logged in to vote

Alright I got it to work, it is a CJS-ESM issue,
Use this rollup plugin https://github.com/eight04/rollup-plugin-cjs-es and add its config in the tsdx config

//tsdx.config.js
const postcss = require('rollup-plugin-postcss')
const cjs = require('rollup-plugin-cjs-es')

module.exports = {
  rollup(config, options) {
    config.plugins.push(
      postcss({
        config: {
          path: './postcss.config.js',
        },
        extensions: ['.css'],
        minimize: true,
        inject: {
          insertAt: 'top',
        },
      })
    ),
// FROM HERE
      config.plugins.push(
        cjs({
          nested: true,
        })
      )
//TO HERE
    return config
  },
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ShubhamVerma1811
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant