настройка webpack

This commit is contained in:
2020-07-05 09:07:36 +03:00
commit 7103f13750
8849 changed files with 920257 additions and 0 deletions

29
webpack.config.js Normal file
View File

@ -0,0 +1,29 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
entry: './src/index.js',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist'),
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
template: './src/index.html'
}),
new MiniCssExtractPlugin({
filename: 'style.css',
}),
],
module: {
rules: [
{
test: /\.css$/i,
use: [MiniCssExtractPlugin.loader, 'css-loader'],
},
{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" }
],
},
};