Добрый день, пересобираю старую сборку на новую.Нужны только скомпиленные css и js.Возникает ошибка при парсинге картинок ../images/ и шрифтов ./fonts. Но мне просто надо пересобрать стили. Подскажите как запретить парсинг адресов url и поправить. url:false очищает адреса ..//images/ . Конфига
let path = require('path');
let webpack = require('webpack');
let ExtractTextPlugin = require('extract-text-webpack-plugin');
let globImporter = require('node-sass-glob-importer');
let HtmlWebpackPlugin = require('html-webpack-plugin');
let autoprefixer = require('autoprefixer');
let postcssclick = require('postcss-click');
let backgroundSvg = require('postcss-encode-background-svgs');
let cssnext = require('postcss-preset-env');
let animation = require('postcss-animation');
let stylelint = require('stylelint');
let CopyPlugin = require('copy-webpack-plugin');
let TerserJSPlugin = require('terser-webpack-plugin');
let MiniCssExtractPlugin = require('mini-css-extract-plugin');
let OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
let conf = {
mode: 'production',
entry: './index.js',
output: {
path: path.resolve(__dirname, '../../../../public_html/assets/new/'),
filename: 'app.js'
},
optimization: {
minimizer: [new TerserJSPlugin({}), new OptimizeCSSAssetsPlugin({})],
},
devServer: {
overlay: true,
port: 3010
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
loader: "babel-loader",
exclude: "/node_modules/"
},
{
test: /\.(sa|sc|c)ss$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: "css-loader",
options: {
hmr: process.env.NODE_ENV === 'development',
sourceMap: true,
}
},
{
loader: 'postcss-loader',
options: {
plugins: [
autoprefixer({
browsers: ['ie >= 8', 'last 4 version']
}),
postcssclick(),
cssnext(),
backgroundSvg(),
animation()
],
sourceMap: true,
}
},
{
loader: 'sass-loader',
options: {
importer: globImporter(),
sourceMap: true,
}
}
],
},
{
test: /\.(pug|jade)$/,
loader: 'pug-loader',
options: {
pretty: true
}
},
{
test: /\.(gif|png|jpe?g|svg)$/i,
loader: 'file-loader',
options: {
name: '[name].[ext]'
},
},
{
loader: 'image-webpack-loader',
options: {
mozjpeg: {
progressive: true,
quality: 70
}
}
},
{
test: /.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]'
}
}]
}
]
},
plugins: [
new MiniCssExtractPlugin({
filename: 'style.css'
}),
new HtmlWebpackPlugin({
template: './index.pug'
}),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery"
}),
new CopyPlugin([
{from: '/images', to: 'images'},
{from: '/fonts', to: 'fonts'}
]),
]
};
module.exports = conf;