Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

add info about finding references in usemin task #619

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

add info about finding references in usemin task #619

wants to merge 4 commits into from

Conversation

ytxiuxiu
Copy link

@ytxiuxiu ytxiuxiu commented Apr 7, 2016

There is no document for how does usemin find references in files.
It is important to tell users about this so that we can write task correctly to ensure usemin replace references which we want to.

There is no document for how does `usemin` find references in files.
It is important to tell users about this so that we can write task correctly to ensure `usemin` replace references which we want to.
@nodox
Copy link

nodox commented Apr 7, 2016

@eddiemonge @stephanebachelier @sindresorhus
Seems good to me. Can anybody sign off before I merge?


`usemin` will look for different kinds of references in files of certain types. The type of the file should be indicated by using target name. That is to say, the target name in the `usemin` task should only be in `html`, `css`, `json` and `svg` so that `usemin` can find possible types of references in these files.

For example, if the target name is `html`, `usemin` will find references of images, scripts, stylesheets, etc. However, `usemin` will only find references which are surrounded by `url(` and `)` when target name is `css`.
Copy link

Choose a reason for hiding this comment

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

I suggest we use url(...) instead of url( and ) as the placeholder.

@eddiemonge
Copy link
Member

The language is a bit confusing. More or better examples might be needed

`usemin` will look for different kinds of references in files of certain types. The type of the file should be indicated by using target name. That is to say, any target name in the `usemin` task should only be in `html`, `css`, `json` and `svg` so that `usemin` can lookup possible types of references in these files of a certain type.

For example, if the target name is `html`, `usemin` will find references of `<img src="..."`, `<script src="..."`, `<link href="..."`, etc.
However, `usemin` will only find references look like `url(...)` when target name is `css`.
Copy link

Choose a reason for hiding this comment

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

"However, usemin will only find references which look like url(...) when target name is css."

Quick edit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants