Skip to content

Commit 9dee844

Browse files
committed
add missing parts
1 parent 2f27e89 commit 9dee844

File tree

5 files changed

+13
-31
lines changed

5 files changed

+13
-31
lines changed

README.md

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,14 @@ Integration tests are performed with [Protractor](http://angular.github.io/protr
171171

172172
## Environment confugration
173173
There is a configuration management in place. Three standart environments are already set (devlopment, test and production).
174-
You can also add more environments with ```--env <env-name>``` but there is a catch: You have to add ```--``` for each npm command you
174+
You can also add more environments with ```--env.target <env-name>``` but there is a catch: You have to add ```--``` for each npm command you
175175
run throw so if your like to set the evnirnment for ```npm start``` you have to do this like so:
176176

177177
```shell
178-
npm start -- -- --env <json-file-name-without-extension>
178+
npm start -- -- --env.target <json-file-name-without-extension>
179179
```
180180

181-
This because ```npm start``` runs ```npm run server:dev``` and then the target command, so we have to to pass the ```--env``` by providing two times ```--```.
181+
This because ```npm start``` runs ```npm run server:dev``` and then the target command, so we have to to pass the ```--env.target``` by providing two times ```--```.
182182
You can find the configurations in ```<root>/environment```.
183183

184184
## HTML5 pushState routing
@@ -191,26 +191,7 @@ extra confuration to enable this.
191191
Initiate cordova with the following commands:
192192
```shell
193193
npm install -g cordova
194-
npm run cordova:init
195-
```
196-
197-
Finally add the following code just before the ```</body>``` closing tag:
198-
```
199-
<!-- Cordova -->
200-
<script src="cordova.js"></script>
201-
```
202-
203-
Cordova has a issue in the way they serve the source code files to the WebView in the platforms. So we have to remove/alter the following code
204-
to make sure everything works in cordova.
205-
206-
Remove the following line in src/index.ejs
207-
```
208-
12: <base href="<%= htmlWebpackPlugin.options.baseUrl %>">
209-
```
210-
211-
Remove the following line in src/app/app.ts
212-
```
213-
8: config.options.pushState = true;
194+
npm run mobile:setup
214195
```
215196

216197
### Run and build
@@ -235,10 +216,10 @@ So make sure you run for example ```npm run build``` first before runing/buildin
235216
- [X] add i18n
236217
- [ ] add materialize.css
237218
- [ ] Add all important libs like moment, lodash ...
238-
- [ ] Add cordova
219+
- [X] Add cordova
239220
- [X] Add travis
240221
- [ ] Add greenkeeper
241-
- [ ] polyfill ES6 promises for tests => replaced phantom with firefox
222+
- [X] polyfill ES6 promises for tests => replaced phantom with firefox
242223
- [ ] Add electron
243224
- [ ] Add wallaby.js
244225
- [ ] Add typedocs

config/config-environment.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"use strict";
22

33
const webpack = require('webpack');
4-
const minimist = require('minimist')(process.argv.slice(2));
54

65
/**
76
* Environment Config
@@ -15,12 +14,11 @@ const configEnv = function (options) {
1514
};
1615

1716
function getDefinitions(env, name, version, platform) {
18-
const environment = minimist.env || env;
1917
return {
2018
NAME: JSON.stringify(name),
2119
VERSION: JSON.stringify(version),
2220
PLATFORM: JSON.stringify(platform),
23-
CONFIG: JSON.stringify(require(process.cwd() + `/environment/${environment}.json`))
21+
CONFIG: JSON.stringify(require(process.cwd() + `/environment/${env}.json`))
2422
};
2523

2624
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
"webpack": "cross-env ./node_modules/.bin/webpack",
3434
"webpack-dev-server": "cross-env ./node_modules/.bin/webpack-dev-server",
3535
"server:coverage": "http-server ./test/coverage --cors",
36-
"cordova:init": "node ./config/init-cordova.js"
36+
"mobile:setup": "node ./config/setup-mobile.js",
37+
"mobile:build": "npm run build:dev -- --env.platform mobile",
38+
"mobile:release": "npm run build:prod -- --env.platform mobile"
39+
3740
},
3841
"repository": {
3942
"type": "git",

test/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = function(config) {
3838
'spec-bundle.js': ['coverage', 'webpack', 'sourcemap']
3939
},
4040

41-
webpack: require('../webpack.config')({ target: 'test' }),
41+
webpack: require('../webpack.config')(),
4242

4343
coverageReporter: {
4444
reporters: [{

webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = function (envArguments) {
1515
const ENV = process.env.NODE_ENV && process.env.NODE_ENV.toLowerCase() || 'development';
1616
const pkg = require(path.join(process.cwd(), 'package.json'));
1717
let PLATFORM = 'web';
18-
let TARGET = 'development';
18+
let TARGET = ENV;
1919
if (envArguments) {
2020
PLATFORM = envArguments.platform || PLATFORM;
2121
TARGET = envArguments.target || TARGET;

0 commit comments

Comments
 (0)