Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

LaraBABA's avatar

Tailwind config issues with node_modules

Hi All,

Any idea how does this works please. I am trying to follow the tutorial here:

https://tailwind-elements.com/quick-start/

I installed the plugin:

npm install tw-elements

And added this to my tailwind.config.js file:

module.exports = {
  content: [
    './resources/**/*.blade.php',
    './resources/**/*.js',
    './resources/**/*.vue',
    './node_modules/tw-elements/dist/js/**/*.js'  <-------
  ],

app.blade.php

 @stack('scripts')
        <script src="./TW-ELEMENTS-PATH/dist/js/index.min.js"></script>
        @if

Which path shall I use above I do not get it.

Thanks!

0 likes
7 replies
Sinnbeck's avatar

It seems you should add it to plug-ins? Not content

  plugins: [
    require('tw-elements/dist/plugin')
  ] 
LaraBABA's avatar

@Sinnbeck Thanks, I already had this at the bottom of the file:

    plugins: [
        require('@tailwindcss/forms'),
        require('@tailwindcss/aspect-ratio'),
        require('tw-elements/dist/plugin')
    ],

I think this "TW-ELEMENTS-PATH" seems wrong. Not sure if they wrote it in caps to show that you have to find your own path or not.

amirkhan47's avatar
Level 4

in resources/js/app.js add import 'tw-elements'; it will work

1 like
LaraBABA's avatar

@amirkhan47 Thank you so much, I was still having issues, this hopefully will fix it.

1 like

Please or to participate in this conversation.