Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 4, 2018
Merged

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

merged 1 commit into from
Oct 4, 2018

Conversation

alan-agius4
Copy link
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

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

Copy link
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.

@@ -158,12 +160,16 @@ export default postcss.plugin('postcss-cli-resources', (options: PostcssCliResou
let match;
let lastIndex = 0;
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
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
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

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