JSPM

  • Created
  • Published
  • Downloads 10677060
  • Score
    100M100P100Q244573F
  • License MIT

file loader module for webpack

Package Exports

  • file-loader

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (file-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

file loader for webpack

Usage

var url = require("file!./file.png");
// => emits file.png as file in the output directory and returns the public url

If you want to have a custom extension on your file, I have some prepared:

require("file/js!./javascript.js");
require("file/html!./page.html");
require("file/txt!./flash.txt");
require("file/png!./image.png");
require("file/jpg!./image.jpg");
require("file/jpeg!./image.jpeg");
require("file/swf!./flash.swf");

Look at the source to write your own. Pre- and postfix is possible.

License

MIT (http://www.opensource.org/licenses/mit-license.php)