Skip to content

Commit

Permalink
fix: make confix.xml symlink for the browser platfrom
Browse files Browse the repository at this point in the history
  • Loading branch information
dekimasoon committed May 12, 2018
1 parent 8b642bc commit 694fe41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 3 additions & 6 deletions generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,16 @@ module.exports = (api, options, rootOptions) => {
})

api.onCreateComplete(() => {
const path = require('path')

// .gitignore - not included in files on postProcessFiles
const ignorePath = api.resolve('.gitignore')
const ignore = fs.existsSync(ignorePath)
? fs.readFileSync(ignorePath, 'utf-8')
: ''
fs.writeFileSync(ignorePath, ignore + '\n# Cordova\n/www\n/platforms\n/plugins\n')

// symlink to platforms
const from = path.relative(process.cwd(), api.resolve('./public/cordova'))
const to = api.resolve('./platforms')
fs.symlinkSync(to, from, 'dir')
// create symlinks
fs.symlinkSync('../platforms', './public/cordova', 'dir')
fs.symlinkSync('../platforms/browser/www/config.xml', './public/config.xml')
})
}

1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ module.exports = (api, options) => {
webpackConfig.plugin('copy')
.tap(args => {
args[0][0].ignore.push('cordova')
args[0][0].ignore.push('config.xml')
return args
})
webpackConfig.plugin('cordova')
Expand Down

0 comments on commit 694fe41

Please sign in to comment.