html-webpack-plugin/examples/html-loader/webpack.config.js

34 lines
958 B
JavaScript
Executable File

var path = require('path');
var HtmlWebpackPlugin = require('../..');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var webpackMajorVersion = require('webpack/package.json').version.split('.')[0];
module.exports = {
context: __dirname,
entry: './example.js',
output: {
path: path.join(__dirname, 'dist/webpack-' + webpackMajorVersion),
publicPath: '',
filename: 'bundle.js'
},
module: {
loaders: [
{ test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') },
{ test: /\.png$/, loader: 'file-loader' },
{ test: /\.html$/, loader: 'html-loader' }
]
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
favicon: 'favicon.ico',
template: 'template.html'
}),
new HtmlWebpackPlugin({
filename: 'about.html',
favicon: 'favicon.ico',
template: 'template.html'
}),
new ExtractTextPlugin('styles.css')
]
};