From aa527978aa87a771572a513b5a0ede81a7f3fd3a Mon Sep 17 00:00:00 2001 From: Jay Varner Date: Thu, 7 Mar 2024 14:31:04 -0500 Subject: [PATCH] Prevent Webpack from watching after build. --- webpack.config.js | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 64a4aa83..7f9e086e 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,31 +1,29 @@ -const path = require('path'); -const webpack = require('webpack'); -const BundleTracker = require('webpack-bundle-tracker'); +const path = require("path"); +const webpack = require("webpack"); +const BundleTracker = require("webpack-bundle-tracker"); module.exports = { context: __dirname, - mode: 'production', - entry: './apps/static/js/index', - watch: true, + mode: "production", + entry: "./apps/static/js/index", + watch: false, output: { - path: path.resolve('./apps/static/js/'), - filename: "[name].js" + path: path.resolve("./apps/static/js/"), + filename: "[name].js", }, - devtool: 'source-map', - plugins: [ - new BundleTracker({filename: './webpack-stats.json'}) - ], + devtool: "source-map", + plugins: [new BundleTracker({ filename: "./webpack-stats.json" })], module: { rules: [ { test: /\.js$/, - enforce: 'pre', - use: ['source-map-loader'], - }, + enforce: "pre", + use: ["source-map-loader"], + }, { test: /\.css$/i, use: ["css-loader"], }, ], - } -} \ No newline at end of file + }, +};