Skip to content

Commit ce427ce

Browse files
committed
fix(@angular/cli): allow build output in outDir outside of project
1 parent c60e8af commit ce427ce

File tree

1 file changed

+5
-4
lines changed
  • packages/@angular/cli/models/webpack-configs

1 file changed

+5
-4
lines changed

packages/@angular/cli/models/webpack-configs/common.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,12 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
9999
// specify a configuration flag.
100100
// Also prevent writing outside the project path. That is not overridable.
101101
const fullOutputPath = path.resolve(buildOptions.outputPath, asset.output);
102-
if (!fullOutputPath.startsWith(projectRoot)) {
103-
const message = 'An asset cannot be written to a location outside the project.';
104-
throw new SilentError(message);
105-
}
106102
if (!fullOutputPath.startsWith(path.resolve(buildOptions.outputPath))) {
103+
if (!fullOutputPath.startsWith(projectRoot)) {
104+
const message = 'An asset cannot be written to a location outside the project.';
105+
throw new SilentError(message);
106+
}
107+
107108
if (!asset.allowOutsideOutDir) {
108109
const message = 'An asset cannot be written to a location outside of the output path. '
109110
+ 'You can override this message by setting the `allowOutsideOutDir` '

0 commit comments

Comments
 (0)