question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dropping target and relativeTo broke my workflow

See original GitHub issue

Hello,

I’ve been using clean-css for some time now and I used both target and relativeTo options to create a “deployable” version of a website (at the same level of the project folder):

\project-A\ => project folder
\project-A-deploy\ => gulp generated distribution / deployable version

My projects follow this logic at the development folder:

\project-A\resouces\include\package-a\file-a.css
\project-A\resouces\include\package-a\image.png
\project-A\resouces\include\package-b\file-b.css
\project-A\resouces\style.css
  • resouces\include is a folder where bower-installed packages end up;
  • those packages include CSS files and images, fonts etc;
  • my code would merge all CSS from every package into a global \project-A-deploy\resources\style.min.css (rebased by clean-css);
  • then it would find/copy additional resources like image.png to the distribution folder keeping the original directory structure. (eg. file \project-A\resouces\include\package-a\image.png gets copied to \project-A-deploy\resouces\include\package-a\image.png)

My problem:

Take \project-A\resouces\include\package-a\file-a.css with the following contents as an example:

div.xpto {
     background: url(image.png)
}

image.png was located at \project-A\resouces\include\package-a\image.png and it would load just fine.

When I merge all CSS, the url() directive needs to take in account the path of the global CSS file at: \project-A-deploy\resources\style.min.css. Meaning the CSS needed to be changed to:

div.xpto {
     background: url(include\package-a\image.png)
}

Using the target and relativeTo I could make this url() change by setting target: "resources" and relativeTo: "". Without them I can’t make it do rebase as I described.

How can I, in v4, do this with rebaseTo? How can I now emulate the behavior of target and relativeTo so I can take advantage of v4 with my desired workflow?

Thank you.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:28 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
TCB13commented, May 15, 2017

@scniro and @jakubpawlowicz thanks for the feedback and work. I’ve tested that version against my test case and in a complex project with lots of other stuff and everything works just fine!

Any ETA for that code to be on the normal repo?

2reactions
jakubpawlowiczcommented, May 7, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

Target Complete Workflow
The Geosoft Database. 22. Database Lines/Groups. 22. Target Supported Data Formats. 23. Database Menus. 24. Drag and Drop Geosoft Database Files.
Read more >
Workflow - xkcd
xkcd: Workflow. [[Changelog for version 10.17 of a piece of software. One change listed: "The CPU no longer overheats when you hold down...
Read more >
GitHub - common-workflow-language/cwltool
Files are mapped from their "resolved" location to a "target" path where they will appear at tool invocation (for example, a location inside...
Read more >
4. Oozie Workflow Actions - Apache Oozie [Book] - O'Reilly
A clear understanding of Oozie's execution model will help us to design, build, run, and troubleshoot workflows. When a user runs a Hadoop...
Read more >
6 Managing Workflows - Oracle Help Center
Workflows are used to specify how content is routed for review, approval, and release to the system. This chapter provides information for understanding...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found