Why use webpack how to#
Choose how to detect webpack configuration Manual configuration is useful if the name of your webpack configuration file is not recognized by PhpStorm, see the list of recognized webpack config names below. With manual configuration, you specify the webpack configuration file to use in your project. With automatic configuration, PhpStorm auto-detects the relevant webpack configuration file for each JavaScript file.
In PhpStorm, you can choose between two configuration modes - automatic and manual. Specify the webpack configuration files to useīased on the analysis of a webpack configuration file, PhpStorm understands the webpack configuration, resolves modules, and provides coding assistance in JavaScript files, see Resolving modules below. Learn more from the webpack official website. If webpack is missing, open the embedded Terminal ( Alt+F12) and type:Ĭreate one or several configuration files depending on your project structure ( New | JavaScript file). Make sure webpack is listed in the dependencies or devDependencies object of your package.json.
Configuring webpack in PhpStorm Add webpack to your package.json
Why use webpack install#
Before you startĭownload and install Node.js. In projects that consist of multiple modules with different webpack configurations, PhpStorm can automatically detect the relevant configuration file for each module and use the module resolution rules from it, see Specifying the webpack configuration file to use below.įor webpack version 2 and later, PhpStorm provides code completion and quick documentation look-up for options in webpack configuration files. This support improves coding assistance in JavaScript files by taking into account webpack module resolution and resolve aliases. PhpStorm integrates with the webpack module bundler.