No problem with the long post, more details help and I should have asked them earlier. Are you using a package to develop your site (e.g. like a theme or site policy package)? The most correct place to persist your changes is doing the work there, including an upgrade step to recompile the plone
bundle after applying via code the changes I suggested you in the UI of Resources Registry (adding select2 resource to plone
bundle).
But for now let's continue with this other route. I found a couple things weird in your files. It's worth doing a git reset --hard
to discard any changes you have in mockup
or git stash
to set them aside for now. Better yet, remove mockup
from your development eggs, you don't need it there unless you plan to open a PR to Plone or use a fork for your project, which is not recommended.
It seems you modified your /usr/local/Plone52/zinstance/src/plone.staticresources/package.json
because you should not have a have a line with "jquery-form": "v4.2.2",
but instead a version more similar (or same) as https://github.com/plone/plone.staticresources/blob/master/package.json. The hard reset should discard those modifications.
Recapitulating the idea is to:
- reconfigure your site's
plone
bundle to include select2 resource <-- I think you did this already, (after we succeed here we can do similarly and disable select2 inplone-logged-in
to avoid loading it twice) - enable buildout generation of
plone-compile-resources
script, as @thet described <-- also this seems to be done (isn't needed in a new installation but you are migrating/upgrading) - run
./bin/plone-compile-resources -b plone
to generate a new final bundle for JS and CSS files, resulting in 4 new files (CSS, JS and their sourcemaps) insrc/plone.staticresources/src/plone/staticresources/static/plone-compiled*
. I usually dogit status
once inside thesrc/plone.staticresources
directory to spot such modified files. - restart your instance(s) and Plone serves the version read from the filesystem (step 3 files), with disabled
Development mode
in Resources Registry
So no running Npm or Yarn manually in this case. Sorry to point in that direction in my last post: I got misguided by the Running command: npm install
you reported earlier, which is normal/expected when running bin/plone-compile-resources
. The pre-requisite of manually running Yarn instead of Npm is for when you are developing in src/mockup
, which is not your need at the moment.
If you still don't get around it maybe we can meet at IRC or Plone Slack channel to get this done.