Сейчас переименовывает только в css.
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const Webpack = require('webpack');
module.exports = {
entry: {
main: './src/index.js'
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'main.js',
publicPath: '',
},
mode: 'development',
devServer: {
contentBase: path.resolve(__dirname, './dist'),
open: true,
compress: true,
port: 8080
},
module: {
rules: [{
test: /\.js$/,
use: 'babel-loader',
exclude: '/node_modules/'
},
{
test: /\.(png|svg|jpg|gif|woff(2)?|eot|ttf|otf)$/,
type: 'asset/resource',
},
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, {
loader: 'css-loader',
options: {
importLoaders: 1,
modules: true
}
},
'postcss-loader'
]
},
]
},
plugins: [
new HtmlWebpackPlugin({
template: './src/pages/index.html',
filename: 'index.html'
}),
new HtmlWebpackPlugin({
template: './src/pages/vacancies.html',
filename: 'vacancies.html'
}),
new HtmlWebpackPlugin({
template: './src/pages/vacancy.html',
filename: 'vacancy.html'
}),
new HtmlWebpackPlugin({
template: './src/pages/contact.html',
filename: 'contact.html'
}),
new HtmlWebpackPlugin({
template: './src/pages/404.html',
filename: '404.html'
}),
new HtmlWebpackPlugin({
template: './src/pages/about.html',
filename: 'about.html'
}),
new HtmlWebpackPlugin({
template: './src/pages/projects.html',
filename: 'projects.html'
}),
new HtmlWebpackPlugin({
template: './src/pages/simple-page.html',
filename: 'simple-page.html'
}),
new CleanWebpackPlugin(),
new MiniCssExtractPlugin(),
new Webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery'
}),
]
}