-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from pauljmelia/dev-server
Added support for ng serve
- Loading branch information
Showing
10 changed files
with
478 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,4 @@ jspm_packages | |
.node_repl_history | ||
|
||
lib | ||
*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { DevServerBuilder } from '@angular-devkit/build-angular'; | ||
import { BuilderContext } from '@angular-devkit/architect'; | ||
import { virtualFs, Path, tags} from '@angular-devkit/core'; | ||
import { SingleSpaBuilderSchema } from '../browser/schema'; | ||
import { Configuration } from 'webpack'; | ||
import * as fs from 'fs'; | ||
import { SingleSpaBrowserBuilder } from '../browser'; | ||
|
||
|
||
export class SingleSpaDevServer extends DevServerBuilder { | ||
constructor(context: BuilderContext) { | ||
super(context); | ||
} | ||
|
||
buildWebpackConfig( | ||
root: Path, | ||
projectRoot: Path, | ||
host: virtualFs.Host<fs.Stats>, | ||
options: SingleSpaBuilderSchema | ||
): Configuration { | ||
const browserBuilder = new SingleSpaBrowserBuilder(this.context); | ||
const webpackConfig = browserBuilder.buildWebpackConfig(root, projectRoot, host, options); | ||
this.context.logger.info(tags.oneLine ` | ||
SINGLE-SPA-ANGULAR: Angular dev server is serving application as a single module`); | ||
return webpackConfig; | ||
} | ||
} | ||
|
||
export default SingleSpaDevServer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
{ | ||
"title": "Dev Server schema for single-spa-angular.", | ||
"description": "Dev Server target options for single-spa-angular.", | ||
"type": "object", | ||
"properties": { | ||
"browserTarget": { | ||
"type": "string", | ||
"description": "Target to serve." | ||
}, | ||
"port": { | ||
"type": "number", | ||
"description": "Port to listen on.", | ||
"default": 4200 | ||
}, | ||
"host": { | ||
"type": "string", | ||
"description": "Host to listen on.", | ||
"default": "localhost" | ||
}, | ||
"proxyConfig": { | ||
"type": "string", | ||
"description": "Proxy configuration file." | ||
}, | ||
"ssl": { | ||
"type": "boolean", | ||
"description": "Serve using HTTPS.", | ||
"default": false | ||
}, | ||
"sslKey": { | ||
"type": "string", | ||
"description": "SSL key to use for serving HTTPS." | ||
}, | ||
"sslCert": { | ||
"type": "string", | ||
"description": "SSL certificate to use for serving HTTPS." | ||
}, | ||
"open": { | ||
"type": "boolean", | ||
"description": "Opens the url in default browser.", | ||
"default": false, | ||
"alias": "o" | ||
}, | ||
"verbose": { | ||
"type": "boolean", | ||
"description": "Adds more details to output logging.", | ||
"default": false | ||
}, | ||
"liveReload": { | ||
"type": "boolean", | ||
"description": "Whether to reload the page on change, using live-reload.", | ||
"default": true | ||
}, | ||
"publicHost": { | ||
"type": "string", | ||
"description": "Specify the URL that the browser client will use." | ||
}, | ||
"servePath": { | ||
"type": "string", | ||
"description": "The pathname where the app will be served." | ||
}, | ||
"disableHostCheck": { | ||
"type": "boolean", | ||
"description": "Don't verify connected clients are part of allowed hosts.", | ||
"default": false | ||
}, | ||
"hmr": { | ||
"type": "boolean", | ||
"description": "Enable hot module replacement.", | ||
"default": false | ||
}, | ||
"watch": { | ||
"type": "boolean", | ||
"description": "Rebuild on change.", | ||
"default": true | ||
}, | ||
"hmrWarning": { | ||
"type": "boolean", | ||
"description": "Show a warning when the --hmr option is enabled.", | ||
"default": true | ||
}, | ||
"servePathDefaultWarning": { | ||
"type": "boolean", | ||
"description": "Show a warning when deploy-url/base-href use unsupported serve path values.", | ||
"default": true | ||
}, | ||
"optimization": { | ||
"description": "Enables optimization of the build output.", | ||
"oneOf": [ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"scripts": { | ||
"type": "boolean", | ||
"description": "Enables optimization of the scripts output.", | ||
"default": true | ||
}, | ||
"styles": { | ||
"type": "boolean", | ||
"description": "Enables optimization of the styles output.", | ||
"default": true | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "boolean" | ||
} | ||
] | ||
}, | ||
"aot": { | ||
"type": "boolean", | ||
"description": "Build using Ahead of Time compilation." | ||
}, | ||
"sourceMap": { | ||
"description": "Output sourcemaps.", | ||
"default": true, | ||
"oneOf": [ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"scripts": { | ||
"type": "boolean", | ||
"description": "Output sourcemaps for all scripts.", | ||
"default": true | ||
}, | ||
"styles": { | ||
"type": "boolean", | ||
"description": "Output sourcemaps for all styles.", | ||
"default": true | ||
}, | ||
"hidden": { | ||
"type": "boolean", | ||
"description": "Output sourcemaps used for error reporting tools.", | ||
"default": false | ||
}, | ||
"vendor": { | ||
"type": "boolean", | ||
"description": "Resolve vendor packages sourcemaps.", | ||
"default": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "boolean" | ||
} | ||
] | ||
}, | ||
"vendorSourceMap": { | ||
"type": "boolean", | ||
"description": "Resolve vendor packages sourcemaps.", | ||
"x-deprecated": true, | ||
"default": false | ||
}, | ||
"evalSourceMap": { | ||
"type": "boolean", | ||
"description": "Output in-file eval sourcemaps.", | ||
"x-deprecated": true | ||
}, | ||
"vendorChunk": { | ||
"type": "boolean", | ||
"description": "Use a separate bundle containing only vendor libraries." | ||
}, | ||
"commonChunk": { | ||
"type": "boolean", | ||
"description": "Use a separate bundle containing code used across multiple bundles." | ||
}, | ||
"baseHref": { | ||
"type": "string", | ||
"description": "Base url for the application being built." | ||
}, | ||
"deployUrl": { | ||
"type": "string", | ||
"description": "URL where files will be deployed." | ||
}, | ||
"progress": { | ||
"type": "boolean", | ||
"description": "Log progress to the console while building." | ||
}, | ||
"poll": { | ||
"type": "number", | ||
"description": "Enable and define the file watching poll time period in milliseconds." | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": [ | ||
"browserTarget" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters