Skip to content
Snippets Groups Projects
Commit 63d5ea84 authored by Sasikumar D R's avatar Sasikumar D R
Browse files

handle endponts with '.' in dev environemnt (browser-sync middleware) #1269

parent 666570d3
No related branches found
No related tags found
No related merge requests found
...@@ -436,6 +436,25 @@ export class SeedConfig { ...@@ -436,6 +436,25 @@ export class SeedConfig {
COLOR_GUARD_WHITE_LIST: [string, string][] = [ COLOR_GUARD_WHITE_LIST: [string, string][] = [
]; ];
protected DEV_REWRITE_RULES = [
{
from: /^\/node_modules\/.*$/,
to: (context:any) => context.parsedUrl.pathname
},
{
from: /^\/app\/.*$/,
to: (context:any) => context.parsedUrl.pathname
},
{
from: /^\/assets\/.*$/,
to: (context:any) => context.parsedUrl.pathname
},
{
from: /^\/css\/.*$/,
to: (context:any) => context.parsedUrl.pathname
}
];
/** /**
* Configurations for NPM module configurations. Add to or override in project.config.ts. * Configurations for NPM module configurations. Add to or override in project.config.ts.
* If you like, use the mergeObject() method to assist with this. * If you like, use the mergeObject() method to assist with this.
...@@ -449,7 +468,11 @@ export class SeedConfig { ...@@ -449,7 +468,11 @@ export class SeedConfig {
* @type {any} * @type {any}
*/ */
'browser-sync': { 'browser-sync': {
middleware: [require('connect-history-api-fallback')({ index: `${this.APP_BASE}index.html` })], middleware: [require('connect-history-api-fallback')({
index: `${this.APP_BASE}index.html`,
rewrites: this.DEV_REWRITE_RULES,
disableDotRule: true
})],
port: this.PORT, port: this.PORT,
startPath: this.APP_BASE, startPath: this.APP_BASE,
open: argv['b'] ? false : true, open: argv['b'] ? false : true,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment