Skip to content

Commit e4a3138

Browse files
committed
refactor(@angular-devkit/build-webpack): reduce configuration path processing
1 parent dc3cdae commit e4a3138

File tree

2 files changed

+8
-6
lines changed
  • packages/angular_devkit/build_webpack/src

2 files changed

+8
-6
lines changed

packages/angular_devkit/build_webpack/src/webpack-dev-server/index.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88
import { BuilderContext, createBuilder } from '@angular-devkit/architect';
9-
import { getSystemPath, json, normalize, resolve } from '@angular-devkit/core';
9+
import { json } from '@angular-devkit/core';
1010
import * as net from 'net';
11+
import { resolve as pathResolve } from 'path';
1112
import { Observable, from, isObservable, of } from 'rxjs';
1213
import { switchMap } from 'rxjs/operators';
1314
import * as webpack from 'webpack';
@@ -112,9 +113,9 @@ export function runWebpackDevServer(
112113
export default createBuilder<
113114
json.JsonObject & WebpackDevServerBuilderSchema, DevServerBuildOutput
114115
>((options, context) => {
115-
const configPath = resolve(normalize(context.workspaceRoot), normalize(options.webpackConfig));
116+
const configPath = pathResolve(context.workspaceRoot, options.webpackConfig);
116117

117-
return from(import(getSystemPath(configPath))).pipe(
118+
return from(import(configPath)).pipe(
118119
switchMap((config: webpack.Configuration) => runWebpackDevServer(config, context)),
119120
);
120121
});

packages/angular_devkit/build_webpack/src/webpack/index.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88
import { BuilderContext, BuilderOutput, createBuilder } from '@angular-devkit/architect';
9-
import { getSystemPath, json, normalize, resolve } from '@angular-devkit/core';
9+
import { json } from '@angular-devkit/core';
10+
import { resolve as pathResolve } from 'path';
1011
import { Observable, from, isObservable, of } from 'rxjs';
1112
import { switchMap } from 'rxjs/operators';
1213
import * as webpack from 'webpack';
@@ -110,9 +111,9 @@ export function runWebpack(
110111

111112

112113
export default createBuilder<WebpackBuilderSchema>((options, context) => {
113-
const configPath = resolve(normalize(context.workspaceRoot), normalize(options.webpackConfig));
114+
const configPath = pathResolve(context.workspaceRoot, options.webpackConfig);
114115

115-
return from(import(getSystemPath(configPath))).pipe(
116+
return from(import(configPath)).pipe(
116117
switchMap((config: webpack.Configuration) => runWebpack(config, context)),
117118
);
118119
});

0 commit comments

Comments
 (0)