add process package it is remove in webpack5

This commit is contained in:
hardiknai-techm
2021-04-28 19:09:41 +05:30
parent 5b467e239a
commit 7d2315f282

View File

@@ -6,7 +6,7 @@ const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin"); const HtmlWebpackPlugin = require("html-webpack-plugin");
const InlineChunkHtmlPlugin = require("react-dev-utils/InlineChunkHtmlPlugin"); const InlineChunkHtmlPlugin = require("react-dev-utils/InlineChunkHtmlPlugin");
const HTMLInlineCSSWebpackPlugin = require("html-inline-css-webpack-plugin").default; const HTMLInlineCSSWebpackPlugin = require("html-inline-css-webpack-plugin").default;
const { EnvironmentPlugin } = require("webpack"); const { EnvironmentPlugin, ProvidePlugin } = require("webpack");
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin"); const CopyWebpackPlugin = require("copy-webpack-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin"); const { CleanWebpackPlugin } = require("clean-webpack-plugin");
@@ -116,7 +116,10 @@ module.exports = function (_env = {}, argv = {}) {
fileName: "version.txt", fileName: "version.txt",
content: `${gitSha.trim()} ${new Date().toUTCString()}`, content: `${gitSha.trim()} ${new Date().toUTCString()}`,
}), }),
new CaseSensitivePathsPlugin(), // new CaseSensitivePathsPlugin(),
new ProvidePlugin({
process: "process/browser",
}),
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({
filename: "[name].[contenthash].css", filename: "[name].[contenthash].css",
}), }),
@@ -230,6 +233,9 @@ module.exports = function (_env = {}, argv = {}) {
crypto: false, crypto: false,
"crypto-browserify": require.resolve("crypto-browserify"), //if you want to use this module also don't forget npm i crypto-browserify "crypto-browserify": require.resolve("crypto-browserify"), //if you want to use this module also don't forget npm i crypto-browserify
}, },
alias: {
process: "process/browser",
},
}, },
optimization: { optimization: {
minimize: mode === "production" ? true : false, minimize: mode === "production" ? true : false,