Webpack freezes when attempting a production build due to UglifyJs

I'm currently using Webpack, and I've encountered an issue when running a production build with the command:

webpack -p

The build process never seems to finish.

After a bit of searching, I discovered that disabling the sourcemap for uglifyjs could resolve this issue. However, I couldn't find a clear explanation on how to actually disable it.

Ideally, I would like to have the option to disable the sourceMap directly from my configuration settings.

This raised another question in my mind - shouldn't I actually want a source map when creating a production build? Disabling this feature feels like a temporary fix rather than a proper solution.

module.exports = {
entry: ["./utils", "./app.js" ],
output: { filename: "bundle.js" },
module:{
 preLoaders:[
  {
    test: /\.js$/,
    exclude: /node_modules/,
    loader: 'jshint-loader'
  }
],
loaders: [
  {
    test:/\.es6$/,
    exclude: /node_modules/,
    loader: "babel",
    query: {
      presets: ['es2015']
    }
  }
 ]
},
resolve: {
 extensions: ['', '.js', '.es6']
},
watch: true
}

UPDATE: It appears that setting watch: true in my config was causing the issue... but I still want to understand how to properly disable source maps.

Answer №1

Extracted from @user104317's message in the feedback area.

When you use the "Watch" command with webpack, it continues to run and update your files automatically as they are modified. Once the building process is complete, the command will persist until manually stopped.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Converting XML data (in SOAP format) to a JSON object using JavaScript

Can AJAX be used to send cross-site requests with a SOAP request and receive an XML response? Additionally, is there a framework similar to Mustache that can easily convert the XML response to JSON format? ...

How to Install the Express Application Generator with npm

Encountering issues with installing certain packages through npm: npm install eslint --save-dev, and npm install -g express-generator The error message is consistent for both: npm ERR! Unexpected end of JSON input while parsing near '...0.2.13":{"na ...

The Highcharts download feature is not available when the title is removed

After setting the title of my chart to null, I noticed that I am no longer able to access the download menu on the chart. Check out this example for reference: http://jsfiddle.net/JVNjs/954/ var chart = new Highcharts.Chart({ chart: { renderT ...

Dependable Timeout Functionality in JavaScript

We are currently developing an AngularJS application that presents users with questions and keeps track of the number of correct answers within a strict 20-minute time limit. However, there are some challenging requirements we need to consider: Accuracy C ...

Troubleshooting npm installation: when <package> installs successfully but npm install fails

When I attempt to download the source code and execute: npm install The installation process crashes (possibly due to running out of memory), but if I directly run: npm install bigchaindb-driver (version 0.3.0) Then it works fine... Error log: npm ht ...

Adjust Node visibility as User scrolls to it using CSS

Suppose I have a structure like this: <br><br><br>...Numerous BRs...<br><br><br> <div id="thetarget"></div><div id="show"></div> <br><br><br>...Numerous BRs...<br><br&g ...

What is the best method for showcasing various content using a uniform accordion style in React?

What is the most efficient way to display various content within multiple accordions? view image description here This is the current approach I am taking in my project, where shipping information and delivery options will involve different textboxes, labe ...

The error message "buildParams: Exceeded maximum call stack size with Uncaught RangeError" was

I'm having trouble pinpointing the mistake. Can someone please assist me? Every time I submit the form, I encounter the following error in the console: Uncaught RangeError: Maximum call stack size exceeded at buildParams I've looked at variou ...

Invoking a Components function from a Service in Angular may lead to a potential cyclic dependency issue

I am facing a challenge where I need to call a function from my filterComponent(component) within my engagementService(service). The function in my filterComponent accesses an array that is located within the engagementService. It uses the data from this ...

What is the most effective way to utilize getStaticPaths in a dynamic manner within next.js

There is a need to paginate static pages for each of the 3 blog categories, but the problem lies in the variable number of pages and the inability to access which category needs to be fetched in getStaticPaths. The project folder structure appears as foll ...

Verifying the presence of an image via its URL may not be functional across all browsers

Hey folks, I'm working on a project that involves displaying an image along with other fields in a loop where the image source changes with each iteration. I also need to check if the image exists and set a default source if it doesn't. The code ...

KineticJS: Applying a filter to an image does not result in the image having a stroke

Working with KineticJS version 5.1.0 I encountered an issue where a KineticJS image that had a stroke lost the stroke after applying a filter to it. I have created a demo showcasing this problem, which can be viewed on JSFiddle. Here is the code snippet: ...

Endless Loop Seamless Vertical JavaScript Experience

I've been working with an HTML table structure of data and was successful in setting up a vertical list loop using some JavaScript. However, I'm facing challenges in achieving a smooth constant vertical scroll. Currently, it goes row by row when ...

How to include the novalidate attribute in an easyUI validatebox

I am attempting to apply the novalidate property to the easyUI validatebox within Jquery's (document).ready() method using the following code: $('#fieldId').attr('novalidate',true); Unfortunately, the code is not executing as exp ...

Encountering an Issue with Dynamic Imports in Cypress Tests Using Typescript: Error Loading Chunk 1

I've been experimenting with dynamic imports in my Cypress tests, for example using inputModule = await import('../../__tests__/testCases/baseInput'); However, I encountered an issue with the following error message: ChunkLoadError: Loading ...

I developed a digital Magic 8 Ball program, but unfortunately, it's only providing me with one response

I'm currently working on a Discord Bot for my friends and myself. One of the scripts I've created is an 8Ball script, but it's only giving me one answer. Here's the code snippet for my variable: var rand = ['Yes', 'No&apo ...

Maintaining a reliable and efficient way to update the userlist in a chatroom using PHP, AJAX, and SQL

I've successfully created a chatroom using PHP, JavaScript, AJAX, and SQL without the use of JQuery or any other tools. I maintain user persistence through session variables to keep users visible on the front page of my website (www.chatbae.com). How ...

Guide to turning off alerts for identifiers starting with an underscore (_)

Exploring ReactJS Development with ESLint Being a developer working with ReactJS, I find great value in the automated assistance provided by ESLint for detecting code issues like unused identifiers. If you're interested in experimenting with ESLint, ...

Use the Vue `this.$router.push` method inside a setTimeout function

I have a landing page '/' that users will see first when they visit our website. I want to display a loading wheel for 5 seconds before automatically redirecting them to the login page '/login'. My Landing.vue page in Vue and Bulma.io ...

Encountering a TypeError indicating that the asterisk is not functioning as a proper function

Whenever I run my server.js file, an error keeps popping up: TypeError: routing is not a function This occurs in the following line of code: routing(app); In my routing.js file, the content looks like this: // JavaScript source code var friends = requ ...