Use of File-loader and Url-loader

Source: Internet
Author: User

File-loader is mainly used for processing pictures, in fact, it can be in JS and HTML and other files, but rarely used, such as:

1 require ("file-loader?name=js/[hash].script.[ ext]!. /javascript.js "); 2 // = Js/0dcbbaa701328a3c262cfd45869e351f.script.js 3 4 require ("file-loader?name=html-[hash:6].html!. /page.html "); 5 // = html-109fa8.html 6 7 require ("file-loader?name=[hash]!. /flash.txt "); 8 // = c31e9820c001c9c4a86bce33ce43b679

Url-loader is an enhanced version of File-loader, you can use the limit parameter

{test:/\. (png|jpg) $/,loader: "Url-loader?limit=8192&name=img/[name][hash:8]. [Ext] "}

Note:file-loader and Url-loader only handle images that have references in the portal node

Use of File-loader and Url-loader

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.