If you're looking for a quick solution, here's an unconventional method to kickstart your project. You can leverage the postinstall
script within your package.json
file to trigger a custom script after running npm install
.
Your setup could resemble the following:
"script": {
"postinstall": "./postinstall.sh",
}
To implement this, create and set permissions for the postinstall.sh
script:
touch postinstall.sh
chmod u+x postinstall.sh
Subsequently, clone the repository and directly build it. For instance, consider the contents of the postinstall.sh
:
#!/usr/bin/env bash
git clone https://github.com/firebase/firebaseui-web.git
cd firebaseui-web
git checkout v3.5.2
npm i
for language in fr en es
do
npm run build build-js-$language
done
However, be prepared for a longer execution time with this approach. Alternatively, refer to Marcel Falliere's suggestion, which may provide a more efficient alternative. I experimented with initiating the build command from the firebaseui
directory within node_modules
. While this requires gulp
, expect an error prompt due to the absence of gulpfile.js
.
You can test out the aforementioned solution on GitHub at:
https://github.com/GabLeRoux/npm-build-firebaseui-postinstall-example
Do note that this method might encounter issues on Windows systems. Consider it as a demonstration rather than a recommended practice 🍻