This repository has been archived by the owner on Apr 20, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 339
add info about finding references in usemin task #619
Open
ytxiuxiu
wants to merge
4
commits into
yeoman:master
Choose a base branch
from
ytxiuxiu:doc-finding-refs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
@eddiemonge @stephanebachelier @sindresorhus |
|
||
`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`. |
There was a problem hiding this comment.
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.
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`. |
There was a problem hiding this comment.
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.