W3cubDocs

/webpack

multi-loader

[![npm][npm]][npm-url] [![node][node]][node-url] [![deps][deps]][deps-url] [![tests][tests]][tests-url] [![chat][chat]][chat-url]

A webpack loader for splitting modules and using multiple loaders. This loader requires a module multiple times, each time loaded with different loaders, as defined in your config.

Note: In a multi-entry, the exports of the last item are exported.

Requirements

This module requires a minimum of Node v6.9.0 and Webpack v4.0.0.

Getting Started

To begin, you'll need to install multi-loader:

$ npm install multi-loader --save-dev

Then add the loader to your webpack config. For example:

// webpack.config.js
const multi = require('multi-loader');
{
    module: {
        loaders: [
            {
                test: /\.css$/,
                // Add CSS to the DOM and return the raw content
                loader: multi(
                    'style-loader!css-loader!autoprefixer-loader',
                    'raw-loader'
                )
            }
        ]
    }
}

And run webpack via your preferred method.

License

MIT MIT" class="icon-link" href="#mit">

© JS Foundation and other contributors
Licensed under the Creative Commons Attribution License 4.0.
https://webpack.js.org/loaders/multi-loader