Forum Discussion

Joseff's avatar
Joseff
Copper Contributor
Mar 01, 2024
Solved

ShadCN ui issues using tailwind-merge

Hey guys, I am trying to use the shadcn ui components in my SPFX solution but have hit a wall. There is a util function it uses to merge tailwind that looks like this import { type ClassV...
  • Joseff's avatar
    Mar 04, 2024
    Think I worked it out

    Setup the config in the gulpfile to:

    build.configureWebpack.mergeConfig({
    additionalConfiguration: (generatedConfiguration) => {
    generatedConfiguration.module.rules.push(
    {
    test: /\.mjs$/,
    include: /node_modules/,
    type: 'javascript/auto'
    },
    {
    // Match `.js`, `.jsx`, `.ts` or `.tsx` files
    test: /\.[jt]sx?$/,
    loader: 'esbuild-loader',
    options: {
    // JavaScript version to compile to
    target: 'es2015'
    }
    },

    );

    generatedConfiguration.resolve.extensions = ['*', '.mjs', '.js', '.json']

    return generatedConfiguration;
    }

    Tried to use the bable loader but didnt have any luck but this all seems to be working ok

Resources