lazy-snark/frontend/webpack.config.js
Игорь Соболев ff7e3ce92b Version ready for deploy
2019-06-23 11:51:31 +03:00

36 lines
849 B
JavaScript

const path = require('path');
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
// use index.js as entrypoint
entry: {
app: ['./index.js']
},
devServer: {
contentBase: './bundle',
hot: true
},
mode: "production",
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}
]
},
// build all code in `bundle.js` in `bundle` directory
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'bundle')
},
plugins: [
// create `index.html` with imported `bundle.js`
new CopyWebpackPlugin([{
from: './*.html'
}]),
new webpack.HotModuleReplacementPlugin()
]
};