Browse Source

do Cordova env by default, add cordova modules in dependencies

jojo 5 years ago
parent
commit
1f35aa1643
4 changed files with 75 additions and 190 deletions
  1. 65 181
      package-lock.json
  2. 6 6
      package.json
  3. 1 1
      src/index.html
  4. 3 2
      src/main.js

File diff suppressed because it is too large
+ 65 - 181
package-lock.json


+ 6 - 6
package.json

@@ -21,13 +21,16 @@
     "share": "npm-run-all --parallel open:src localtunnel",
     "test": "mocha --reporter progress \"src/**/*.test.js\"",
     "test:watch": "npm run test -- --watch",
-    "clean": "git clean -fdx -e node_modules"
+    "clean": "rm -rf platforms plugins webpack www/dist www/index.html www/assets"
   },
   "author": "JOJO",
   "license": "MIT",
   "dependencies": {
     "phaser": "3.19.0",
-    "socket.io-client": "^2.3.0"
+    "socket.io-client": "^2.3.0",
+    "cordova-android": "^8.1.0",
+    "cordova-browser": "^6.0.0",
+    "cordova-windows": "^7.0.1"
   },
   "devDependencies": {
     "@babel/cli": "7.6.2",
@@ -45,11 +48,8 @@
     "clean-webpack-plugin": "3.0.0",
     "copy-webpack-plugin": "^5.1.1",
     "cordova": "^9.0.0",
-    "cordova-android": "^8.1.0",
-    "cordova-browser": "^6.0.0",
     "cordova-plugin-webpack": "^0.4.7",
     "cordova-plugin-whitelist": "^1.3.4",
-    "cordova-windows": "^7.0.1",
     "eslint": "6.4.0",
     "eslint-plugin-import": "2.18.2",
     "eslint-watch": "6.0.1",
@@ -77,4 +77,4 @@
       "windows"
     ]
   }
-}
+}

+ 1 - 1
src/index.html

@@ -38,7 +38,7 @@
 </head>
 
 <body>
-  <% if (process.env.CORDOVA) { %>
+  <% if (!process.env.DEV || process.env.DEV === false) { %>
 
   <div class="app">
     <h1>Twelve Heroes</h1>

+ 3 - 2
src/main.js

@@ -55,9 +55,10 @@ let app = {
   }
 };
 
-console.log('cordova  :', process.env.CORDOVA );
+console.log('cordova  :', process.env.DEV );
 
-if (process.env.CORDOVA) {
+
+if (!process.env.DEV || process.env.DEV === false) {
 
   app.initialize();
 } else {

Some files were not shown because too many files changed in this diff