Webpack Source Analysis--Configuration debugging environment

Source: Internet
Author: User

Whether it is reading Webpack source code, or writing Webpack plugin and loader, it is necessary to configure the debugging environment. Weabpack running environment is NODEJS, debugging Webpack is debugging Nodejs program. The Ides we use, such as Eclipse and Webstorm, support Nodejs debugging. This article takes Eclipse (version:oxygen.1a Release (4.7.1a)) as an example to explain.

In this example, we use Webpack <entry> [<entry>] <output> This usage, the project specific directory structure is as follows:

--index.html

--index.js

--hello.js

Content in index.html:

Content in Index.js:

Content in Hello.js:

Build command: Webpack./index.js bundle2.js

First step, create a new Debug configuration item

Second step, fill in the configuration item

Name :names of Debug configuration items

The file under the Main tab: the entry for the program. Webpack's entry file is the webpack.js in the bin directory

Then click on the Arguments tab to configure

Program Arguments:

The example in this article is to execute the webpack./index.js bundle2.js command, so the parameters are configured in the program variable programs arguments:./index.js bundle2.js

If you are configuring directly using the Webpack.config.js configuration file, and the command used on the command line is Webpack, this situation can be done without configuring program Arguments

Working Directory:

directory where the program is being debugged

Step three, set breakpoint execution

The configuration of the other Ides is similar.

Webpack Source Analysis--Configuration debugging environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.