Skip to content

Commit

Permalink
Put webpack bundle analyzer behind flag
Browse files Browse the repository at this point in the history
  • Loading branch information
poltak committed Feb 27, 2024
1 parent 4d05c39 commit 9774faa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ export default function ({
runSentry = false,
notifsEnabled = false,
shouldPackage = false,
shouldAnalyze = false,
packagePath = '../dist',
extPackageName = 'extension.zip',
sourcePackageName = 'source-code.zip',
}) {
const { defaultEnv, envPath } = initEnv({ mode })

const plugins = [
new BundleAnalyzerPlugin(),
new EnvironmentPlugin(defaultEnv),
new Dotenv({ path: envPath }),
new CopyPlugin(staticFiles.copyPatterns),
Expand Down Expand Up @@ -81,6 +81,10 @@ export default function ({
new IgnorePlugin(/^\.\/locale$/, /moment$/),
]

if (shouldAnalyze) {
plugins.unshift(new BundleAnalyzerPlugin())
}

if (mode === 'development' && process.env.NO_CACHE !== 'true') {
plugins.push(
new HardSourcePlugin({
Expand Down

0 comments on commit 9774faa

Please sign in to comment.