Closed mcaskill closed 2 years ago
Just tested on my end π The only thing I would correct is the extra '
in concat.js
on line 46 ( concatenated'
=> concatenated
).
Looks great! π
However it seems to be greedier than before, compilation times seems to be longer now on my end. Which I get for styles because of postcss & autoprefixer, but I don't understand for scripts π€
Refactored the structure of the configuration file and tasks to allow for greater flexibility.
Replaced legacy
mconfig.json
with newloconfig.json
. Base paths, and proxy URL, are grouped underpaths
. Targets to process are grouped undertasks
. Previously hardcoded, each task can now process multiple targets.Added:
glob.js
: A proxy function to check if one of tiny-glob, globby, fast-glob, or glob is available and export their main function or a facade for interoperability.If packages are missing, throws an error.
The globbing function is used by
concats.js
.The tiny-glob package is required by default (and can be replaced).
postcss.js
: A proxy function to check if autoprefixer and postcss are available and export the processor.If packages are missing,
styles.js
will still compile Sass to CSS.Both packages are required by default (and can be removed).
template.js
: A function to render template tags ({% ... %}
) in task target paths using thepaths
fromloconfig.json
.Changed:
concat.js
,scripts.js
,styles.js
,svgs.js
to newbuild/tasks/
directory.fs
(callback API) withfs/promises
(promise API) to streamline readability and catching of errors and improve asynchronous processing of tasks.concats.js
:concat.js
to represent its new flexibility.scripts.js
:app.js
) to iterate over to compile JS bundles.styles.js
:main.css
andcritical.css
) to iterate over to compile Sass stylesheets.sass.render
.svgs.js
:sprite.svg
) to iterate over to compile SVG spritesheets.message.json
:if
statements withswitch
for improved readability.notice
andwarning
.waiting
type which will just log the current timer.notification.json
:build/utils/
directory.watch.js
:README.md
:scripts/modules/*.js
:import
.