Browse Source

Fix env variables usage in webpack

jojo 5 years ago
parent
commit
8f10a7fcac
2 changed files with 5 additions and 5 deletions
  1. 1 1
      src/index.html
  2. 4 4
      webpack.config.js

+ 1 - 1
src/index.html

@@ -38,7 +38,7 @@
 </head>
 
 <body>
-  <% if (process.env.CORDOVA && process.env.CORDOVA === true) { %>
+  <% if (process.env.CORDOVA === true) { %>
 
   <div class="app">
     <div id="deviceready" class="blink">

+ 4 - 4
webpack.config.js

@@ -22,12 +22,12 @@ var definePlugin = new webpack.DefinePlugin({
 
 var outpath = './webpack/';
 
-if (process.env.CORDOVA && process.env.CORDOVA === true) {
-  outpath = 'www/';
+if (process.env.CORDOVA === true) {
+  outpath = './www/';
   console.log('CORDOVA environment : output in ',outpath);
-} else if (process.env.WEB && process.env.WEB === true) {
+} else if (process.env.WEB === true) {
+  outpath = './www_web/';
   console.log('WEB environment : output in ',outpath);
-  outpath = 'www_web/';
 } else {
   console.log('DEV env : output in ', outpath);
 }