-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to develop a webpack package locally ? #1129
Comments
Yea, this is not a super easy process. You should (and it sounds like you already are) follow the examples from the symfony/ux repository - e.g. https://github.com/symfony/ux/tree/2.x/src/Autocomplete What I usually do (and there is almost definitely some room for improvement) is this: A) I have a WIP version of my bundle locally Now, about the JS part, which is what you're really asking about.
Make sure you have the If your bundle is setup correctly (and it sounds like it is), you should now have the Let me know what issues you hit. The process is cumbersome, and I'd welcome any automation or documentation for this. Additionally, I often will disable the Stimulus controller I'm working on in Cheers! |
Hi, a great thank you ! You saved my day by fixing the half of the issues ! About A/B/C, I am doing this way. About In bundle, my assets are in assets/ folder, as required by documentation, my bundle has no compiled ressources as it has to consider the style and customization of main projet, so the main project compiled it, it could contain SCSS files, JS services, JS stimulus controllers, other JS classes... I will try your tips, I tried to override watch options to change ignored properties in webpack.config.js with no real success.
It's inspired from something I found on the internet But for this part, I am still stuck with core-js issue. I will answer you in the mentioned issue. EDIT:
But I am still having the core-js issue. |
I am also trying to figure out how to create a I was able to create a setup for local development to use existing solutions completely without hacking core files. Here's what I did:
There is no Hope it helps someone |
Thank you for this issue. |
Hi,
I am developing a Symfony bundle using classic Sf features (views, controllers, entities,...;) but with also JS stimulus controllers and SCSS.
So, the project stack is Npm + Webpack Encore + Stimulus + PHP + Symfony 6.1.
By installing the local composer package, Flex should consider my bundle as an embedded node module, but Flex does nothing, I linked it manually, this works but not perfectly and I would do it the legit way.
To develop the bundle, I created a package.json in the assets folder in a separate project. The package is added to the project by its local path on my file system using "file:", then I run npm run watch, this is working properly, sometimes I am getting errors with missing core-js.
But by developing locally, I would changes to be detected by webpack to compile the new changes. Using "file:", yarn/node seems to create a copy of my sources, so it won't listen the sources for changes.
I also tried using link: but webpack is failing to compile.
So the whole thing is a bunch of wonky repairs and I did not find a good tutorial to explain how to do that with Webpack Encore + Sf 6.1.
How to develop a webpack package locally ?
How is this recommended ?
Considering, I can not run a symfony or docker server, everything is on a local VM and PhpStorm is deploying automatically on it..
NB: I am looking for information, I tried stackoverflow with no success.
The text was updated successfully, but these errors were encountered: