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

Commit

Permalink
fix(demo): add support for running a demo of the widgets locally. (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuawilson authored Sep 4, 2018
1 parent 41dcf1e commit 2ceac6f
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 7 deletions.
7 changes: 6 additions & 1 deletion config/webpack.demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ module.exports = {
{
test: /\.ts$/,
use: [
'ts-loader',
{
loader: 'ts-loader',
options: {
configFile: 'tsconfig-demo.json'
}
},
'angular2-template-loader'
],
exclude: [/\.(spec|e2e)\.ts$/]
Expand Down
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
"build:bundle": "npm-run-all --serial build:library",
"build:demo": "npm-run-all --serial 'rimraf -- dist-demo' demo:copy-examples demo:webpack",
"build:library": "npm run rimraf -- build dist dist-watch src/**/*.css && gulp build",
"clean": "npm cache clear --force && npm run rimraf -- package-lock.json node_modules doc coverage dist distwatch bundles",
"clean": "npm cache clear --force && npm run rimraf -- package-lock.json node_modules doc coverage dist distwatch dist-demo dist-watch bundles",
"demo:copy-examples": "gulp copy-examples",
"demo:start": "npm-run-all --serial demo:copy-examples demo:webserver",
"demo:webpack": "webpack --config config/webpack.demo.js --progress --profile --bail",
"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",
"lint:less": "stylelint 'src/**/*.less' --config .stylelintrc",
"lint:less:fix": "npm run lint:less -- --fix",
"lint:ts": "tslint -c tslint.json 'src/**/*.ts'",
Expand All @@ -22,14 +26,13 @@
"remove-dist": "rimraf dist dist-watch",
"rimraf": "rimraf",
"semantic-release": "semantic-release",
"start": "webpack-dev-server --config config/webpack.demo.js --progress --host 0.0.0.0 --port 3001 --profile --watch --content-base src/",
"start": "npm run demo:start",
"test": "npm run test:unit",
"test:unit": "karma start",
"test:debug": "karma start --no-single-run --browsers Chrome",
"test:browsers": "karma start --browsers Chrome,Firefox,Safari",
"transpile": "gulp transpile",
"transpile-less": "gulp transpile-less",
"watch:library": "gulp watch"
"watch:library": "gulp watch",
"webpack-dev-server": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js"
},
"license": "Apache-2.0",
"contributors": [
Expand Down
43 changes: 43 additions & 0 deletions tsconfig-demo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"angularCompilerOptions": {
"genDir": "compiled",
"skipTemplateCodegen": true,
"strictMetadataEmit": true
},
"atom": { "rewriteTsconfig": false },
"buildOnSave": false,
"compileOnSave": false,
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"allowUnreachableCode": false,
"baseUrl": ".",
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"inlineSources": true,
"lib": [ "dom", "es6" ],
"module": "es2015",
"moduleResolution": "node",
"noEmitHelpers": false, // Planner and demo won't run when true
"noImplicitAny": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"outDir": "dist",
"paths": {
"@angular/core": ["node_modules/@angular/core"],
"@angular/http": ["node_modules/@angular/http"],
"@angular/router": ["node_modules/@angular/router"],
"rxjs/*": ["node_modules/rxjs/*"]
},
"rootDir": ".",
"skipLibCheck": true,
"sourceMap": true,
"strictNullChecks": false,
"stripInternal": true,
"suppressImplicitAnyIndexErrors": true,
"target": "es5"
},
"files": [
"src/app/index.ts"
]
}
5 changes: 4 additions & 1 deletion tsconfig-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"moduleResolution": "node",
"noEmitHelpers": false, // Planner and demo won't run when true
"noImplicitAny": true,
"outDir": "dist",
"noUnusedLocals": false,
"noUnusedParameters": false,
"outDir": "dist-demo",
"paths": {
"@angular/core": ["node_modules/@angular/core"],
"@angular/http": ["node_modules/@angular/http"],
Expand All @@ -32,6 +34,7 @@
"sourceMap": true,
"strictNullChecks": false,
"stripInternal": true,
"suppressImplicitAnyIndexErrors": true,
"target": "es5"
},
"files": [
Expand Down

0 comments on commit 2ceac6f

Please sign in to comment.