Skip to content
This repository has been archived by the owner on May 6, 2019. It is now read-only.

Commit

Permalink
Merge pull request #62 from D-Mobilelab/GMY-3138
Browse files Browse the repository at this point in the history
Gmy 3138
  • Loading branch information
gianni committed Oct 22, 2018
2 parents 2134172 + 1aa886c commit 1a57487
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 30 deletions.
12 changes: 2 additions & 10 deletions .env-cmdrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,14 @@
"development": {
"NODE_ENV": "development",
"APP_ENV": "WEB",
"ROOT_DIRECTORY": "http://d2.motime.com/js/wl/webstore_html5game/gfsdk/3.x.x/dist/"
"ROOT_DIRECTORY": "//s2_motime.buongiorno.com/js/wl/webstore_html5game/gfsdk/3.x.x/dist/"
},
"production": {
"NODE_ENV": "production",
"APP_ENV": "WEB",
"ROOT_DIRECTORY": "http://d.motime.com/js/wl/webstore_html5game/gfsdk/3.x.x/dist/"
"ROOT_DIRECTORY": "//s.motime.com/js/wl/webstore_html5game/gfsdk/3.x.x/dist/"
},
"test":{
"NODE_ENV": "test"
},
"hybrid-development":{
"NODE_ENV": "development",
"APP_ENV": "HYBRID"
},
"hybrid-production":{
"NODE_ENV": "production",
"APP_ENV": "HYBRID"
}
}
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
"test:coverage": "jest --coverage --no-cache && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
"test:watch": "jest --watch",
"test": "jest",
"build:hybrid:dev": "$(npm bin)/env-cmd hybrid-development webpack --config tools/webpack.config.dev.js",
"build:hybrid:prod": "$(npm bin)/env-cmd hybrid-production webpack --config tools/webpack.config.prod.js -p",
"build:dev": "$(npm bin)/env-cmd development webpack --config tools/webpack.config.dev.js",
"build:prod": "$(npm bin)/env-cmd production webpack --config tools/webpack.config.prod.js -p",
"dev": "env-cmd development webpack-dev-server --config tools/webpack.config.local.js",
Expand Down
5 changes: 1 addition & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ import { Provider } from 'react-redux';
import store from './store';

import App from './App';
import { localStorage } from './js/lib/LocalStorage';
// import { localStorage } from './js/lib/LocalStorage';
import SDK from './SDK';
import { getLabel } from './js/actions/utils';

/* global __webpack_public_path__:true, RUNTIME_PUBLIC_PATH */
if (process.env.APP_ENV === 'HYBRID') {
__webpack_public_path__ = RUNTIME_PUBLIC_PATH;
}

let ROOT_ELEMENT = null;
function onDomLoaded() {
Expand Down
2 changes: 0 additions & 2 deletions src/js/actions/session-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { showBanner } from './banner-actions';
import location from '../lib/Location';

let onStartCallback = () => { };
const hybrid = process.env.APP_ENV === 'HYBRID';

function doStartSession() {
return (dispatch, getState) => {
Expand Down Expand Up @@ -113,7 +112,6 @@ export function endSession(data = { score: 0, level: 1 }) {

const bannerCondition = [
(user.matchPlayed % 3 === 0),
!hybrid,
(generic.platformInfo.android || generic.platformInfo.ios),
vhost.INSTALL_HYBRID_VISIBLE,
].every(condition => condition === true);
Expand Down
3 changes: 0 additions & 3 deletions src/js/lib/FacebookInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ export class FacebookInterface {
* @memberof FacebookInterface
*/
init(config) {
if (process.env.APP_ENV === 'HYBRID') {
return;
}
this.config = config;
this.downloadSDK();
}
Expand Down
2 changes: 0 additions & 2 deletions src/js/reducers/generic.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ export default function generic(state = {
focus: true,
}, action) {
switch (action.type) {
case 'SET_IS_HYBRID':
return Object.assign({}, state, { hybrid: action.hybrid });
case 'SET_LABEL':
return Object.assign({}, state, { label: action.label });
case 'INIT_START':
Expand Down
5 changes: 1 addition & 4 deletions tools/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ var webpack = require('webpack');
var baseConfiguration = require('./webpack.config.base');
var devConfiguration = Object.create(baseConfiguration);

var FILENAME = '[name].js';
var FILENAME_HYBRID = '[name].hybrid.js';

var envPlugin = new webpack.DefinePlugin({
'process.env': {
APP_ENV: JSON.stringify(process.env.APP_ENV),
Expand All @@ -22,7 +19,7 @@ if(process.env.ROOT_DIRECTORY) {
devConfiguration.output.publicPath = ROOT_DIRECTORY;
}

devConfiguration.output.filename = process.env.APP_ENV === "WEB" ? FILENAME : FILENAME_HYBRID;
devConfiguration.output.filename = '[name].js';

devConfiguration.devtool = 'eval-source-map';
devConfiguration.plugins.push(envPlugin);
Expand Down
4 changes: 1 addition & 3 deletions tools/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ var webpack = require('webpack');
const CleanWebpackPlugin = require('clean-webpack-plugin');
var baseConfiguration = require('./webpack.config.base');
var getAssetsChunkName = require('./getAssetsChunkName')(process.env.NODE_ENV);
var FILENAME = '[name].[chunkhash:5].min.js';
var FILENAME_HYBRID = '[name].[chunkhash:5].hybrid.min.js';

var prodConfiguration = Object.create(baseConfiguration);
var ROOT_DIRECTORY = null;
Expand All @@ -16,7 +14,7 @@ if (process.env.ROOT_DIRECTORY) {
prodConfiguration.output.publicPath = ROOT_DIRECTORY;
}

prodConfiguration.output.filename = process.env.APP_ENV === "WEB" ? FILENAME : FILENAME_HYBRID;
prodConfiguration.output.filename = '[name].[chunkhash:5].min.js';
prodConfiguration.devtool = 'source-map';

prodConfiguration.plugins = [
Expand Down

0 comments on commit 1a57487

Please sign in to comment.