Nutrias Punching Marmots

    css-rewrite-webpack-plugin

    0.1.1 • Public • Published

    Rewrite CSS Assets Webpack Plugin

    A Webpack plugin to rewrite CSS assets.

    What does the plugin do?

    It will search for CSS assets during the Webpack build and you can rewrite the CSS.

    var CssRewritePlugin = require('css-rewrite-webpack-plugin');
    module.exports = {
        module: {
            loaders: [
                { test: /\.css$/, loader: ExtractTextPlugin.extract("style-loader", "css-loader") }
            ]
        },
        plugins: [
            new ExtractTextPlugin("styles.css"),
            new CssRewritePlugin({
                fileReg: new RegExp('static/css/dist.css'),
                processor: function (source) {
                    return source.replace(/static\/fonts/g, '..\/fonts')
                }
            })
        ]
    }

    License

    MIT

    Install

    npm i css-rewrite-webpack-plugin

    DownloadsWeekly Downloads

    65

    Version

    0.1.1

    License

    MIT

    Last publish

    Collaborators

    • imawe