У меня проблемы с wp4, вчера я сделал несколько сборок, но теперь, после удаления папки dist, он начал выдавать эти проблемы, используя кеш или обслуживание памяти вместо создания файлов
Моя структура приложения:
- Корневая папка
- публичный
- источник
конфиги тут
Мой конфиг веб-пакета:
//const MiniCssExtractPlugin = require("mini-css-extract-plugin")
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const HtmlWebpackPlugin = require("html-webpack-plugin");
const path = require('path')
console.log("Bundling the application..")
module.exports = {
watch: true,
target: 'web',
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'build'),
publicPath: '',
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader",
query: {
presets: ['react', 'es2015', 'env'],
plugins: ['transform-class-properties']
}
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract({
loader: 'css-loader',
options: {
modules: true,
minimize: true
}
})
},
/*{
test: /\.css$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
// you can specify a publicPath here
// by default it use publicPath in webpackOptions.output
publicPath: '',
modules: true
}
},
"css-loader"
]
},*/
{
test: /\.(woff(2)?|ttf|png|jpg|gif|svg)$/,
loader: 'file-loader',
/*loader: "file-loader?name=/img/[name].[ext]", */
query: {
name: '[name].[ext]?[hash]'
}
}
]
},
plugins: [
new ExtractTextPlugin({
filename: 'web.css',
disable: false,
allChunks: true
}),
/*new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: "[name].css",
chunkFilename: "[id].css"
}),*/
new HtmlWebpackPlugin({
title: "Track on Performance",
template: "./public/index.html",
filename: "index.html"
})
],
resolve: {
extensions: ['.js', '.json', '.jsx']
},
devServer: {
port: 3000,
watchContentBase: true,
compress: true
}
};
У меня нет ошибок на консоли, как вы также можете попробовать Mini Css Extract, но проблема все еще здесь