Without further ado, I present to you Version 5 of @lipemat/js-boilerplate. This is a brand new major version which focuses on clearing out previously existing pain points from version 4 and before.
Version 5 is stable and ready for general use.
Admin.js Support:
Previously, if you wanted to add another entry-point to the app, it was possible by using a config override and specifying your entry there. We have found (especially since the implementation of Gutenberg) that within the majority of our implementations we require an additional “admin.js” entry-point for concurrently building for the back-end.
Now adding an entry-point is as simple as creating an “admin.js” file in the same directory as the standard “index.js.” Webpack will automatically see the new file and generate application files for both.
-
index.js
->dist/master.js
-
admin.js
=>dist/admin.js
Cleaner Logging:
Until now the console logs have been fairly verbose, commonly forcing messages to previous screens and requiring scrolling to see everything. Now they display only the important information and are much cleaner.
If you wish, you may optionally adjust the log levels using a config override and returning a stats value to Webpack. The default is set to “minimal” for the start
script and “sensible” (nearly minimal) for dist
script.
Proper error logging has also been added to the dist
script.
Breaking Changes:
With any major release, there are always some backward compatibility issues. Here are the only two.
Entry:
The entry
key in both the webpack.dev
and webpack.dist
has been changed from an array to an object. This only affects apps using config overrides that change the entry
configuration.
For sites changing the entry
key, migration should be pretty straight forward.
Script Integrity:
Previously the master.js
file would be added to /dist/manifest.json
as “main.js” because the name was not specified in the entry. Going forward, the name will match master.js
and will need to be updated anywhere you are retrieving the integrity from the manifest.json
file.