Do you have any idea how to rebuild the ReactJS files for the "master" branch ?
1/ I installed the necessary dependencies :
* From Weathermap plugin's root :
Code: Select all
$ npm install
$ npm audit fix
$ composer update
Code: Select all
$ npm install
$ npm audit fix --force
Code: Select all
--- postbuild-orig.js 2019-06-11 15:49:58.102675877 +0200
+++ postbuild.js 2019-06-11 15:50:09.090316355 +0200
@@ -8,14 +8,14 @@
const src = './build/';
const dest = '../../cacti-resources/mgmt/';
-const targets = ["main.js", "main.css", "main.css.map", "main.js.map"];
+const targets = ["main.js", "main.css"];
//const target = "main.js";
for (let target of targets) {
- let file = require('./build/asset-manifest.json')[target];
+ let file = require('./build/asset-manifest.json')["files"][target];
console.log(`${src}${file} => ${dest}${target}`);
if (!fs.existsSync(dest)) {
Code: Select all
$ npm run build
> cacti-mgmt@1.0.0 build /var/www/cacti/cacti-1.2.3/plugins/weathermap/websrc/cacti-mgmt
> react-scripts build
Creating an optimized production build...
Compiled successfully.
File sizes after gzip:
78.56 KB build/static/js/2.5cdd15b6.chunk.js
6.95 KB build/static/js/main.bb1cce28.chunk.js
1.22 KB build/static/css/main.2f1ad4ce.chunk.css
762 B build/static/js/runtime~main.a8a9905a.js
353 B build/static/css/2.126055ff.chunk.css
The project was built assuming it is hosted at the server root.
You can control this with the homepage field in your package.json.
For example, add this to build it for GitHub Pages:
"homepage" : "http://myname.github.io/myapp",
The build folder is ready to be deployed.
You may serve it with a static server:
npm install -g serve
serve -s build
Find out more about deployment here:
https://bit.ly/CRA-deploy
> cacti-mgmt@1.0.0 postbuild /var/www/cacti/cacti-1.2.3/plugins/weathermap/websrc/cacti-mgmt
> node postbuild.js
./build//static/js/main.bb1cce28.chunk.js => ../../cacti-resources/mgmt/main.js
./build//static/css/main.2f1ad4ce.chunk.css => ../../cacti-resources/mgmt/main.css
----------
This is the React UI below here
INCOMPLETE
Testing API
Map List - Settings - Map Files
----------
-> Does anyone know how to rebuild the "main.js" and "main.css" files with all the features currently available on "master" ? I intend to apply the same for "cacti-user/" once this one will be solved
Let me know !
Gilles