0

I write my own Symfony bundle.

I know that you can import assets from a bundle:

.addEntry('isotop', './vendor.../js/isotop.js')

But - this brings problems when you want to use tailwind-css. For Tailwind you have to configure the webpack.config.js:

  .enablePostCssLoader((options) => {
         options.config = {
          // directory where the postcss.config.js file is stored
                 path: './postcss.config.js'
         };
   })

It would be nice when the bundle could create an Webpack Encore Configuration by itself. Is this possible somehow?

halfer
  • 19,824
  • 17
  • 99
  • 186
Slowwie
  • 1,146
  • 2
  • 20
  • 36
  • 1
    That’s not even remotely possible since you have you own set of npm dependencies while the app may have its own. You should bundle all the assets so any post processing is not required. – Mike Doe Apr 09 '20 at 20:06
  • Ah ok. U are right. Nobody will develop my bundle when installed ;). Ty – Slowwie Apr 10 '20 at 14:37
  • Another solution would be to document which dependencies/settings are required by your bundle and ask users to import your JS/CSS/... from their own files. – Lyrkan Apr 10 '20 at 21:46
  • The problem is, I write some kind of CMS. And it should be possible for others to extend that CMS with Symfony Bundles. This extentions should be installable by click for the users of the cms. – Slowwie Apr 12 '20 at 11:42

1 Answers1

2

That’s not even remotely possible since you have you own set of npm dependencies while the app may have its own. You should bundle all the assets so any post processing is not required.

Mike Doe
  • 16,349
  • 11
  • 65
  • 88