1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-21 11:35:34 +01:00

Exclude content scripts from source maps (#2377)

This commit is contained in:
Oscar Hinton 2022-02-14 15:06:14 +01:00 committed by GitHub
parent cf08e4eab8
commit 9bc4358e85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ const HtmlWebpackPlugin = require("html-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin"); const CopyWebpackPlugin = require("copy-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const { AngularWebpackPlugin } = require("@ngtools/webpack"); const { AngularWebpackPlugin } = require("@ngtools/webpack");
const TerserPlugin = require("terser-webpack-plugin");
if (process.env.NODE_ENV == null) { if (process.env.NODE_ENV == null) {
process.env.NODE_ENV = "development"; process.env.NODE_ENV = "development";
@ -103,11 +104,15 @@ const plugins = [
new webpack.ProvidePlugin({ new webpack.ProvidePlugin({
process: "process/browser", process: "process/browser",
}), }),
new webpack.SourceMapDevToolPlugin({
exclude: /content\/.*/,
filename: "[file].map",
}),
]; ];
const config = { const config = {
mode: ENV, mode: ENV,
devtool: ENV === "development" ? "eval-source-map" : "source-map", devtool: false,
entry: { entry: {
"popup/polyfills": "./src/popup/polyfills.ts", "popup/polyfills": "./src/popup/polyfills.ts",
"popup/main": "./src/popup/main.ts", "popup/main": "./src/popup/main.ts",
@ -122,6 +127,11 @@ const config = {
}, },
optimization: { optimization: {
minimize: true, minimize: true,
minimizer: [
new TerserPlugin({
exclude: /content\/.*/,
}),
],
splitChunks: { splitChunks: {
cacheGroups: { cacheGroups: {
commons: { commons: {