0
votes

I am trying to publish ionic app to www folder,I want create www folder with index.html and css,js folders...

npm run ionic:build

this command create build folder not www(but not problem I can change build folder name to www) folder.And in build folder there is index.html but when I click it,it is blank page not my react page

How can I create www folder in ionic app?A www folder which include working index.html page,js and css folders

1

1 Answers

0
votes

You can basically move the default folder to www folder after the build command is finished, so you want to edit the package.json and do something like this:

...
  "scripts": {
    "ionic:build": "ionic-app-scripts build && mv build www",
    "ionic:serve": "ionic-app-scripts serve"
  },
...

I also found that you need to have permissions to move the folder, so run your code editor as admin. After that, you can't just click the index.html, the folder needs to be deployed or you may serve it with a static server.