40 lines
742 B
JavaScript
40 lines
742 B
JavaScript
const path = require('path')
|
|
var HtmlWebpackPlugin = require('html-webpack-plugin')
|
|
|
|
module.exports = {
|
|
entry: './src/index.js',
|
|
output: {
|
|
filename: 'bundle.js',
|
|
path: path.resolve(__dirname, 'dist')
|
|
},
|
|
devServer: {
|
|
port: 3000
|
|
},
|
|
plugins: [
|
|
new HtmlWebpackPlugin({
|
|
template: './src/index.html'
|
|
})
|
|
],
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.css$/i,
|
|
use: [
|
|
'style-loader',
|
|
'css-loader'
|
|
// 'handlebars-loader', // handlebars loader expects raw resource string
|
|
// 'extract-loader'
|
|
]
|
|
},
|
|
{
|
|
test: /\.(png|jpe?g|gif)$/i,
|
|
use: [
|
|
{
|
|
loader: 'file-loader'
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|