XF 2.3 Problem with js folder not being included in release process

MFA Baybars

Member
I added the following content to the src\addons\AAA\BBB\_build\build.json file directory.
When I run the php cmd.php xf-addon:build-release AAA/BBB command, the _build\build.json folder and file are deleted. The js folder and files are not included in the Release zip archive.

I am performing this operation via localhost xampp terminal. Am I doing something wrong or is there a problem or method that I don't know about?

Code:
{
  "additional_files": [
    "js/AAA/BBB"
  ],
  "minify": [
    "js/AAA/BBB/aa_nn_aaaaa_aaa_abc.js",
    "js/AAA/BBB/aa_bb_aaaab_cde.js",
    "js/AAA/BBB/aa_bb_aaaac_efg.js"
  ],
  "exec": [
    "echo '{title} version {version_string} ({version_id}) has been built successfully!' > 'src/addons/AAA/BBB/_build/built.txt'"
  ]
}

I followed the steps here: https://xenforo.com/docs/dev/development-tools/#building-an-add-on-release
 
You don't need the files in the root js/ tree at all. In your templates eg. you can use:

HTML:
<xf:js addon="AAA/BBB" src="AAA/BBB/aa_nn_aaaaa_aaa_abc.js" min="1" />

They'll automatically be served from _files when development mode is enabled, built into your release, and served directly by the web server in production. There isn't currently anything similar for styles/ unfortunately, though I've used symlinks in the past as a work-around.
 
My problem is that I cannot include the js files in the released zip archive when releasing via cli. I tried many different ways in both the root directory and the _files directory. Maybe it's something related to Xampp, I don't know.
 
I've only just caught this, but build.json should be in your add-on directory and not in the _build sub-directory.
ahaha thanks, Even getting the error below made me happy :)

27/27 [============================] 100%
Written successfully.
Attempting to validate addon.json file...
JSON file validates successfully!

Building release ZIP.
Unexpected error while minifying JS: Empty result provided by the compiler.
 
Oops, that's related to the deprecation of the minification service we use. It's been addressed in the next update, but in the meantime you can either manually configure a local Closure Compiler or forgo minification temporarily.

 
Back
Top Bottom