Webpack Swig loader
Webpack loader for swig templates.
How to use
Webpack configuration
You can define swig loader using webpack configuration.
module:loaders:test: /\.swig$/ loader: "swig-loader";
Require parameter
You can load swig template using require parameter.
var template = ;
Passing swig options
You can pass swig options to the loader using swigLoader.options({ ... })
or loader query parameters. If you choose loader query parameters take a look at query webpack standard query format.
// Option #1 - Swig loader global optionsvar swigLoader = ;swigLoaderoptionsvarControls: '{:' ':}';// Option #2 - Swig loader query parametersvar swigLoader = ;
Passing template parameters
You can pass template parameters to the loader using resource query parameters. If you need to pass some parameters take a look at query webpack standard query format.
var swigLoader = ;
Customizers
You can customize query
, resourceQuery
and result
using customizers:
var swigLoader = ;swigLoader;swigLoader;swigLoader;