I usually put minified JS files in a two-level subfolder (
<vendor>/<addon>
) of
js
and use the unminified version within
_files
for development.
So I'd probably have the file in
src/addons/Andrew/Articles/_files/js/andrew/articles/reading-progress.js
In the template this would be referenced as
Code:
<xf:js addon="Andrew/Articles" src="andrew/articles/reading-progress.js" min="1" />
(No need to change this, works for production and dev).
To build the Add-on a
build.json
is required
Code:
{
"additional_files": [
"js/andrew/articles/reading-progress.js"
],
"minify": [
"js/andrew/articles/reading-progress.js"
]
}
In order to use the unminified JS file from
_files
(via
devjs.php
) the following code in
config.php
ist required as well (as already mentioned):
PHP:
$config['development']['fullJs'] = true;