Hello Ionic-Community,
I would like to execute an extern JavaScript-File (copy files from X to Y) when ionic serve is running and something has be changed, so the livereload gets triggered.
Is there some kind of hook in the app-scripts-module where I can attach the JavaScript-File / the JavaScript-Code?
Greetings,
Michael
SerQuicky:
app-scripts-module
@SerQuicky Did you try taking a look at the copy in: @ionic/app-scripts - npm ?
It also occurs to me that you overwrite the file: ionic_copy (--copy
or -y
) with yours and add custom tasks.
Check the options in documentation before and check this post:
I used a similar solution as well. Got to finally work how I wanted as well. I was wanting to copy a enviroment configuration file that changes depending on using ionic serve vs ionic build platform. That way I can dynamically change the api url’s. For others the following solution below will also work:
package.json
"scripts": {
"build": "ionic-app-scripts build --dev --copy ./config/production.js",
"watch": "ionic-app-scripts watch --copy ./config/development.js",
"serve:before": "watch",
"em…
1 Like
Thanks for reply, with the help of your comment and the linked thread I was able to implement the extern script.
1 Like