0.1.2 • Published 7 years ago

webpack-extract-bundle-text v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Extract Bundle Text Plugin

npm install --save-dev webpack-extract-bundle-text

Extracts text from webpack bundle into an additional asset.

const ExtractBundleTextPlugin = require('webpack-extract-bundle-text');

module.exports = {
    entry: {
        'index.html': path.resolve(__dirname, 'src/index.html'),
    },
    module: {
        rules: [
            {
                test: /\.html$/,
                loader: 'html-loader?interpolate',
            },
        ]
    },
    plugins: [new ExtractBundleTextPlugin('index.html')]
}

Options

By chunk name (the generated output file will equal the chunk name)

new ExtractTextPlugin('index.html')

Or by file names

new ExtractTextPlugin({
    inputFile: 'index.html.js',
    outputFile: 'index.html',
})

Or the options can also be an array

new ExtractTextPlugin(['index.html', '404.html'])
new ExtractTextPlugin([
    {
        inputFile: 'index.html.js',
        outputFile: 'index.html',
    }, {
        inputFile: '404.html.js',
        outputFile: '404.html',
    },
])
0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago