Skip to content

Commit

Permalink
cordova
Browse files Browse the repository at this point in the history
  • Loading branch information
Elevista committed Jan 10, 2019
1 parent 1133d33 commit b9d7d30
Show file tree
Hide file tree
Showing 6 changed files with 324 additions and 35 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ node_modules
.vscode
.tscache
.idea
/platforms/
/plugins/
www/**
!www/favicon.ico
!www/index.html
47 changes: 47 additions & 0 deletions config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.elevista.vue2048" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Vue 2048</name>
<description>
Vue base 2048
</description>
<author email="[email protected]" href="https://github.com/Elevista/vue-2048">
Apache Cordova Team
</author>
<platform name="android">
<icon density="ldpi" src="res/2048.png" />
<icon density="mdpi" src="res/2048.png" />
<icon density="hdpi" src="res/2048.png" />
<icon density="xhdpi" src="res/2048.png" />
<icon density="xxhdpi" src="res/2048.png" />
<icon density="xxxhdpi" src="res/2048.png" />
</platform>
<platform name="ios">
<icon height="57" src="res/2048.png" width="57" />
<icon height="114" src="res/2048.png" width="114" />
<icon height="72" src="res/2048.png" width="72" />
<icon height="144" src="res/2048.png" width="144" />
</platform>
<content src="index.html" />
<access origin="*" />
<preference name="HeaderColor" value="#faf8ef" />
<preference name="StatusBarBackgroundColor" value="#faf8ef" />
<preference name="Fullscreen" value="true" />
<hook src="hooks/beforePrepare.js" type="before_prepare" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<engine name="android" spec="^6.4.0" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
<plugin name="cordova-plugin-headercolor" spec="^1.0.0" />
<plugin name="cordova-plugin-statusbar" spec="^2.4.2" />
</widget>
14 changes: 14 additions & 0 deletions hooks/beforePrepare.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const webpack = require('webpack')
const webpackConfig = require('../webpack.config')
const fs = require('fs')
module.exports = function (context) {
if (!fs.existsSync('www')) fs.mkdirSync('www')
let prod = context.cmdLine.includes('--release')
return new Promise((resolve, reject) => {
webpack(webpackConfig({prod}), (err, stats) => {
let log = stats.toString({colors: true})
console.log(log);
(err || stats.hasErrors()) ? reject(log) : resolve(log)
})
})
}
282 changes: 247 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b9d7d30

Please sign in to comment.