Skip to content
This repository was archived by the owner on Mar 22, 2019. It is now read-only.

list of loaders

Andrey Okonetchnikov edited this page Jun 17, 2014 · 179 revisions

basic

  • json: Loads file as JSON
  • raw: Loads raw content of a file (as utf-8)
  • bundle: Wraps request in a require.ensure block
  • val: Executes code as module and consider exports as javascript code
  • imports: imports stuff to the module
  • exports: exports stuff from the module
  • expose: expose exports from a module to the global context
  • script: Executes a javascript file once in global context (like in script tag), requires are not parsed.
  • source-map: Extract sourceMappingURL comments from modules and offer it to webpack

packaging

  • file: Emits the file into the output folder and returns the (relative) url.
  • url: The url loader works like the file loader, but can return a Data Url if the file is smaller than a limit.
  • worker: The worker loader creates a WebWorker for the provided file. The bundling of dependencies of the Worker is transparent.

dialects

  • coffee: Loads coffee-script like javascript
  • coffee-redux: Loads coffee-script like javascript
  • json5: Like json, but not so strict.
  • es6: Loads ES6 modules.
  • livescript: Loads LiveScript like javascript
  • sweetjs: Use sweetjs macros.

templating

  • html: Exports HTML as string, require references to static resources.
  • jade: Loads jade template and returns a function
  • jade-html: Loads jade template and returns generated HTML
  • template-html: Loads any template with consolidate.js and returns generated HTML
  • handlebars: Loads handlebars template and returns a function
  • dust: Loads dust template and returns a function
  • ractive: Pre-compiles Ractive templates for interactive DOM manipulation
  • jsx: Transform jsx code for React to js code.
  • ejs: Loads EJS (underscore( templating engine) template and returns a pre-compiled function
  • yml: Converts YAML to JSON

styling

  • style: Add exports of a module as style to DOM
  • css: Loads css file with resolved imports and returns css code
  • less: Loads and compiles a less file
  • sass: Loads and compiles a scss file
  • stylus: Loads and compiles a stylus file
  • rework: Post-process CSS with Rework and returns CSS code

support

  • mocha: do tests with mocha in browser or node.js
  • coverjs: PostLoader to code coverage with CoverJs
  • jshint: PreLoader for linting code.
  • injectable: Allow to inject dependencies into modules
  • transform: Use browserify transforms as loader.

Clone this wiki locally