Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

@filipesilva fix(@angular-devkit/build-angular): validate fileReplacements, allow string styles/scripts #667

Merged
merged 1 commit into from
Apr 12, 2018
Merged

@filipesilva fix(@angular-devkit/build-angular): validate fileReplacements, allow string styles/scripts #667

merged 1 commit into from
Apr 12, 2018

Conversation

filipesilva
Copy link
Contributor

@filipesilva filipesilva commented Apr 10, 2018

@@ -67,10 +67,17 @@
"src": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you oneOf this instead? With this current schema we could have { replaceWith: "foo" } which is clearly invalid.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that is better.

@@ -279,7 +279,7 @@ function extractProjectsConfig(config: CliConfig, tree: Tree): JsonObject {
...(isProduction && serviceWorker ? { serviceWorker: true } : {}),
fileReplacements: [
{
src: `${app.root}/${source}`,
source: `${app.root}/${source}`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The form I'd like to see is { replace: "some/file/path", with: "some/other/file" } which to mean feels more natural. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with that.

@filipesilva filipesilva changed the title fix(@angular-devkit/build-angular): validate fileReplacements @filipesilva fix(@angular-devkit/build-angular): validate fileReplacements, allow string styles/scripts Apr 12, 2018
@hansl hansl merged commit 3d809ef into angular:master Apr 12, 2018
@filipesilva filipesilva deleted the file-replacements-source branch April 13, 2018 08:01
filipesilva added a commit that referenced this pull request Apr 16, 2018
/**
* Replace files with other files in the build.
*/
fileReplacements: FileReplacements[];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think this type - 'FileReplacements' - made into the source. I've looked around for it, but haven't found it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hansl pushed a commit to angular/angular-cli that referenced this pull request Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants