I have an old Sage 9 theme that I was upgrading to webpack 5. I am getting not errors when I run yarn build:production
but no dist
folder is created. I’ve seen similar issue in the forums but it’s all someone changed the name of the a folder or has an error come up that comes up that would prevent the build from completing.
I’ve tried npm webpack build[:production] --config resources/assets/build/webpack.config.js --stats verbose
with no issues coming back. Does this sound familiar to someone? I am not well versed in webpack for sure.
Have you upgraded your old Sage 9.x theme to webpack 5 using the latest commit in Sage 9 branch of Sage repository?
Have you applied this Theme update approach (previously used for the Sage 9.x update branch (Sage "9.1": Please test))?
Updating an existing Sage 9 theme (quick guide)
- Create a new Sage 9 project with the command above,
select the framework that is also used by your own Sage 9 project. - (It is assumed that your own Sage project is already under version control (as
git
).
Copy all the files of the newly created, empty Sage 9 project over the ones of your own Sage 9 project,
overwrite everything. You can skip thevendor/
folder to speed things up slightly. - Use diff/merge tools to resolve any differences, apply your own configuration and adjust it if necessary. Updating to
webpack
4
and5
requires surprisingly little configuration changes. - Invoke
composer update
or, if there is trouble, remove thecomposer.lock
file (it shouldn’t cause issues most of the time) and invokecomposer install
. - Invoke
npm install
, or, if there is trouble, remove thepackage-lock.json
and/oryarn.lock
(it shouldn’t cause issues as the base dependencies are already maxed out) and invokenpm install
.
Also note that recentnpm
is much faster than in the earlier days, so you may want to switch back tonpm
, but this is up to you. - Invoke
npm run build
, the theme should build fine, fix your re-applied configuration if otherwise. - Test your theme, styles and images should load as before.
3 Likes
I haven’t, will give this a try. Thanks.