-
-
Notifications
You must be signed in to change notification settings - Fork 432
App build process
For app build you will need the following software installed:
- node.js (10.*)
- npm (>= 6.*)
- python (>= 2.5.0 && < 3.0.0)
- electron (in version used by Publii), electron-packager, node-gyp and gulp node.js modules installed globally
Only for Windows:
npm install --global --production windows-build-tools
Only for macOS:
- Install XCode
In the root project directory run:
npm install
cd app
npm install
cd ..
npm run dev
When the files are compiled run:
gulp prepare-editor-css
Then create the app/dist/vendor catalog and copy the following catalogs to this newly created vendor catalog:
- app/src/helpers/vendor/jquery
- app/src/helpers/vendor/tinymce
Now you can run the Publii app:
npm run build
Please remember to have running the dev command in the second terminal process:
npm run dev
It will allows you to refresh the app with changes without app restart - just click Ctrl+R
shortcut to refresh the app.
If you get errors regarding improper version of some node modules according to your node.js version, run the following command in the directory of these modules:
- app/node_modules/keytar
- app/node_modules/sharp
- app/node_modules/node-expat
- app/node_modules/better-sqlite3
node-gyp rebuild --target=ELECTRON_VERSION --arch=x64 --dist-url=https://atom.io/download/electron
ELECTRON_VERSION - replace with current version of the Electron used in the app.
Alternatively you can use electron-rebuild
if installed globally under the app/
directory
Before creating installer copy app/node_modules/sharp/vendor/lib
catalog to the Publii.app
generated with npm run packager:osx
- without it, the sharp library won't work.
- Post editor
After refreshing the app under development mode in the above views, the app will crash.
If you have problems with the E_ACCESS, you can try to add in the npm commands the following params: --unsafe-perm=true --allow-root
.