Skip to content
This repository was archived by the owner on May 7, 2021. It is now read-only.

Commit 2ceac6f

Browse files
authored
fix(demo): add support for running a demo of the widgets locally. (#155)
1 parent 41dcf1e commit 2ceac6f

File tree

4 files changed

+61
-7
lines changed

4 files changed

+61
-7
lines changed

config/webpack.demo.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ module.exports = {
8282
{
8383
test: /\.ts$/,
8484
use: [
85-
'ts-loader',
85+
{
86+
loader: 'ts-loader',
87+
options: {
88+
configFile: 'tsconfig-demo.json'
89+
}
90+
},
8691
'angular2-template-loader'
8792
],
8893
exclude: [/\.(spec|e2e)\.ts$/]

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
"build:bundle": "npm-run-all --serial build:library",
1212
"build:demo": "npm-run-all --serial 'rimraf -- dist-demo' demo:copy-examples demo:webpack",
1313
"build:library": "npm run rimraf -- build dist dist-watch src/**/*.css && gulp build",
14-
"clean": "npm cache clear --force && npm run rimraf -- package-lock.json node_modules doc coverage dist distwatch bundles",
14+
"clean": "npm cache clear --force && npm run rimraf -- package-lock.json node_modules doc coverage dist distwatch dist-demo dist-watch bundles",
15+
"demo:copy-examples": "gulp copy-examples",
16+
"demo:start": "npm-run-all --serial demo:copy-examples demo:webserver",
17+
"demo:webpack": "webpack --config config/webpack.demo.js --progress --profile --bail",
18+
"demo:webserver": "npm run webpack-dev-server -- --config config/webpack.demo.js --host 0.0.0.0 --port 8001 --progress --profile --hot --content-base dist-demo",
1519
"lint:less": "stylelint 'src/**/*.less' --config .stylelintrc",
1620
"lint:less:fix": "npm run lint:less -- --fix",
1721
"lint:ts": "tslint -c tslint.json 'src/**/*.ts'",
@@ -22,14 +26,13 @@
2226
"remove-dist": "rimraf dist dist-watch",
2327
"rimraf": "rimraf",
2428
"semantic-release": "semantic-release",
25-
"start": "webpack-dev-server --config config/webpack.demo.js --progress --host 0.0.0.0 --port 3001 --profile --watch --content-base src/",
29+
"start": "npm run demo:start",
2630
"test": "npm run test:unit",
2731
"test:unit": "karma start",
2832
"test:debug": "karma start --no-single-run --browsers Chrome",
2933
"test:browsers": "karma start --browsers Chrome,Firefox,Safari",
30-
"transpile": "gulp transpile",
31-
"transpile-less": "gulp transpile-less",
32-
"watch:library": "gulp watch"
34+
"watch:library": "gulp watch",
35+
"webpack-dev-server": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js"
3336
},
3437
"license": "Apache-2.0",
3538
"contributors": [

tsconfig-demo.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"angularCompilerOptions": {
3+
"genDir": "compiled",
4+
"skipTemplateCodegen": true,
5+
"strictMetadataEmit": true
6+
},
7+
"atom": { "rewriteTsconfig": false },
8+
"buildOnSave": false,
9+
"compileOnSave": false,
10+
"compilerOptions": {
11+
"allowSyntheticDefaultImports": true,
12+
"allowUnreachableCode": false,
13+
"baseUrl": ".",
14+
"declaration": true,
15+
"emitDecoratorMetadata": true,
16+
"experimentalDecorators": true,
17+
"inlineSources": true,
18+
"lib": [ "dom", "es6" ],
19+
"module": "es2015",
20+
"moduleResolution": "node",
21+
"noEmitHelpers": false, // Planner and demo won't run when true
22+
"noImplicitAny": true,
23+
"noUnusedLocals": false,
24+
"noUnusedParameters": false,
25+
"outDir": "dist",
26+
"paths": {
27+
"@angular/core": ["node_modules/@angular/core"],
28+
"@angular/http": ["node_modules/@angular/http"],
29+
"@angular/router": ["node_modules/@angular/router"],
30+
"rxjs/*": ["node_modules/rxjs/*"]
31+
},
32+
"rootDir": ".",
33+
"skipLibCheck": true,
34+
"sourceMap": true,
35+
"strictNullChecks": false,
36+
"stripInternal": true,
37+
"suppressImplicitAnyIndexErrors": true,
38+
"target": "es5"
39+
},
40+
"files": [
41+
"src/app/index.ts"
42+
]
43+
}

tsconfig-test.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
"moduleResolution": "node",
2121
"noEmitHelpers": false, // Planner and demo won't run when true
2222
"noImplicitAny": true,
23-
"outDir": "dist",
23+
"noUnusedLocals": false,
24+
"noUnusedParameters": false,
25+
"outDir": "dist-demo",
2426
"paths": {
2527
"@angular/core": ["node_modules/@angular/core"],
2628
"@angular/http": ["node_modules/@angular/http"],
@@ -32,6 +34,7 @@
3234
"sourceMap": true,
3335
"strictNullChecks": false,
3436
"stripInternal": true,
37+
"suppressImplicitAnyIndexErrors": true,
3538
"target": "es5"
3639
},
3740
"files": [

0 commit comments

Comments
 (0)