{"action":"created","issue":{"url":"https://api.github.com/repos/driftyco/ionic/issues/8583","repository_url":"https://api.github.com/repos/driftyco/ionic","labels_url":"https://api.github.com/repos/driftyco/ionic/issues/8583/labels{/name}","comments_url":"https://api.github.com/repos/driftyco/ionic/issues/8583/comments","events_url":"https://api.github.com/repos/driftyco/ionic/issues/8583/events","html_url":"https://github.com/driftyco/ionic/issues/8583","id":181874717,"number":8583,"title":"Ionic 2 RC0 Pre-Populated databases","user":{"login":"iursevla","id":13489488,"avatar_url":"https://avatars.githubusercontent.com/u/13489488?v=3","gravatar_id":"","url":"https://api.github.com/users/iursevla","html_url":"https://github.com/iursevla","followers_url":"https://api.github.com/users/iursevla/followers","following_url":"https://api.github.com/users/iursevla/following{/other_user}","gists_url":"https://api.github.com/users/iursevla/gists{/gist_id}","starred_url":"https://api.github.com/users/iursevla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iursevla/subscriptions","organizations_url":"https://api.github.com/users/iursevla/orgs","repos_url":"https://api.github.com/users/iursevla/repos","events_url":"https://api.github.com/users/iursevla/events{/privacy}","received_events_url":"https://api.github.com/users/iursevla/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-09T08:40:11Z","updated_at":"2016-10-10T08:40:05Z","closed_at":null,"body":"In ionic beta 11 i would put the pre-populated database on /www folder and use  [cordova-sqlite-ext plugin](https://github.com/litehelpers/cordova-sqlite-ext) with options:\r\n``` \r\nlet options = { name: 'myDatabase.db', existingDatabase: true };\r\n```\r\nNow in RC0, it won't work because everytime we run (ionic run...) the www folder is overwritten. \r\nI tried to put it on **/src** OR in **/src/assets** but with no luck in both cases.\r\n\r\nSo, **where should i put pre-populated databases in ionic 2 RC0** ?"},"comment":{"url":"https://api.github.com/repos/driftyco/ionic/issues/comments/252562091","html_url":"https://github.com/driftyco/ionic/issues/8583#issuecomment-252562091","issue_url":"https://api.github.com/repos/driftyco/ionic/issues/8583","id":252562091,"user":{"login":"stellasoft-charlie","id":10418768,"avatar_url":"https://avatars.githubusercontent.com/u/10418768?v=3","gravatar_id":"","url":"https://api.github.com/users/stellasoft-charlie","html_url":"https://github.com/stellasoft-charlie","followers_url":"https://api.github.com/users/stellasoft-charlie/followers","following_url":"https://api.github.com/users/stellasoft-charlie/following{/other_user}","gists_url":"https://api.github.com/users/stellasoft-charlie/gists{/gist_id}","starred_url":"https://api.github.com/users/stellasoft-charlie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stellasoft-charlie/subscriptions","organizations_url":"https://api.github.com/users/stellasoft-charlie/orgs","repos_url":"https://api.github.com/users/stellasoft-charlie/repos","events_url":"https://api.github.com/users/stellasoft-charlie/events{/privacy}","received_events_url":"https://api.github.com/users/stellasoft-charlie/received_events","type":"User","site_admin":false},"created_at":"2016-10-10T08:40:05Z","updated_at":"2016-10-10T08:40:05Z","body":"Ionic supports writing custom config files - https://github.com/driftyco/ionic-app-scripts#custom-config-files . \r\nThis will let you write your own js file where you can declare everything you would like to copy over into the www directory. \r\ncreate a file along side your pacjage.json called for example, copy.config.js , inside this add the following:\r\n\r\n`module.exports = {\r\n  include: [\r\n    {\r\n      src: 'src/assets/',\r\n      dest: 'www/assets/'\r\n    },\r\n    {\r\n      src: 'src/index.html',\r\n      dest: 'www/index.html'\r\n    },\r\n    {\r\n      src: 'src/your.db',\r\n      dest: 'www/your.db'\r\n    },\r\n    {\r\n      src: 'src/service-worker.js',\r\n      dest: 'www/service-worker.js'\r\n    },\r\n    {\r\n      src: 'node_modules/ionic-angular/polyfills/polyfills.js',\r\n      dest: 'www/build/polyfills.js'\r\n    },\r\n    {\r\n      src: 'node_modules/ionicons/dist/fonts/',\r\n      dest: 'www/assets/fonts/'\r\n    },\r\n  ]\r\n};\r\n`\r\nThen in your package.json add a config option with the following.\r\n\r\n>   \"config\": {\r\n    \"ionic_copy\": \"./copy.config.js\"\r\n  },\r\n\r\nPut the pre-populated DB in the src folder and it will copy it over along with the rest of the files\r\n\r\n"}}
{"actor":{"display_login":"stellasoft-charlie"}}