This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

simple-rework-loader

0.1.3 • Public • Published

simple-rework-loader

Simple webpack 2 loader for CSS post-processing with Rework.

Installation

npm install --save-dev simple-rework-loader

Usage

Add to your webpack config file and use in module.rules.

const reworkLoader = require('simple-rework-loader');

Configuration

// Add plugins
const reworkPluginUrl = require('rework-plugin-url');

function changeImageUrls(url) {
    return url.replace(/^(\.\.\/)*images\//, '/assets/images/');
}

// Write rules
module.exports = {
    // <...>
    module: {
        rules: [
            {
                test: /\.css$/,
                use: [{
                    loader: reworkLoader,
                    options: {
                        plugins: [reworkPluginUrl(changeImageUrls)]
                    }
                }]
            }
        ]
    }
}

options.plugins accepts an array of functions or a function. Plugins are applied right to left.

License

MIT

Dependents (0)

Package Sidebar

Install

npm i simple-rework-loader

Weekly Downloads

0

Version

0.1.3

License

MIT

Last publish

Collaborators

  • rimselis