Skip to content

fix(@angular-devkit/build-angular): resolve assets in styles relative to importee#12437

Merged
alexeagle merged 1 commit intoangular:masterfrom
alan-agius4:fix_assets_import
Oct 4, 2018
Merged

fix(@angular-devkit/build-angular): resolve assets in styles relative to importee#12437
alexeagle merged 1 commit intoangular:masterfrom
alan-agius4:fix_assets_import

Conversation

@alan-agius4
Copy link
Copy Markdown
Collaborator

Closes #12430

@alan-agius4 alan-agius4 added target: major This PR is targeted for the next major release and removed cla: yes labels Oct 2, 2018
@googlebot
Copy link
Copy Markdown

☹️ Sorry, but only Googlers may change the label cla: yes.

Copy link
Copy Markdown
Member

@clydin clydin left a comment

Choose a reason for hiding this comment

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

This works well for CSS files and is a good improvement. Unfortunately, preprocessors internally handle imports for their respective file types making this ineffective in those cases.

let modified = false;

// We want to load it relative to the file that imports
const context = path.dirname(decl.source.input.file) || loader.context;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

will decl.source.input.file always return a string? If not then path.dirname will throw.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

based on the typings and some tests it should

clydin
clydin previously approved these changes Oct 2, 2018
@alexeagle alexeagle merged commit 0cfd573 into angular:master Oct 4, 2018
@alan-agius4 alan-agius4 deleted the fix_assets_import branch October 4, 2018 04:18
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI 7.0.0-rc.1 SCSS Build Error with Relative src: url('../') Paths

4 participants