简体   繁体   中英

Understanding webpack.Configuration

import * as webpack from 'webpack';

...

transforms.webpackConfiguration = (config: webpack.Configuration) => {
    patchWebpackConfig(config, options);

While reading some code from an Angular project I stumbled over this code above. What I am curios about is the argument passed to the anonymus function: webpack.Configuration . After some research I couldn't find a documentation to this dataype and on my local machine I am not able to "step into" and look at the actual implementation. If you have some information or useful links to this topic I would really appreciate it.

cheers

Just to be sure you know what you are looking at: the right hand side of the : in the arrow function argument is the TypeScript type annotation, so the function has only one argument ( config ), which is of the type webpack.Configuration .

The types for webpack are maintained in the package @types/webpack (state of July 2020). If you want to have a look at them, install them using npm install @types/webpack and open node_modules/@types/webpack/index.d.ts , you should find the interface Configuration there inside the namespace webpack .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM