Closed iursevla closed 8 years ago
Ionic supports writing custom config files - https://github.com/driftyco/ionic-app-scripts#custom-config-files . This will let you write your own js file where you can declare everything you would like to copy over into the www directory. create a file along side your package.json called for example, copy.config.js , inside this add the following:
module.exports = { include: [ { src: 'src/assets/', dest: 'www/assets/' }, { src: 'src/index.html', dest: 'www/index.html' }, { src: 'src/uki.db', dest: 'www/uki.db' }, { src: 'src/service-worker.js', dest: 'www/service-worker.js' }, { src: 'node_modules/ionic-angular/polyfills/polyfills.js', dest: 'www/build/polyfills.js' }, { src: 'node_modules/ionicons/dist/fonts/', dest: 'www/assets/fonts/' }, ] }; `
Then in your package.json add a config option with the following.
"config": { "ionic_copy": "./copy.config.js" },
Put the pre-populated DB in the src folder and it will copy it over along with the rest of the files
Hello! Thanks for opening an issue with us! As this seems like more of a support question i will urge that you ask this question on our forum and take a look at the app-scripts docs. Thanks for using Ionic!
Hello! I am going to reopen this issue and move it to the app-scripts repo. We are reviewing the current setup where www
is treated as a throw away directory and I will use this issue to post our findings. Thanks!
This issue was moved to driftyco/ionic-app-scripts#127
In ionic beta 11 i would put the pre-populated database on /www folder and use cordova-sqlite-ext plugin with options:
Now in RC0, it won't work because everytime we run (ionic run...) the www folder is overwritten. I tried to put it on /src OR in /src/assets but with no luck in both cases.
So, where should i put pre-populated databases in ionic 2 RC0 ?