Loaders allow webpack to process other types of files and convert them into valid modules that can be consumed by your application and added to the dependency graph. Out of the box, webpack only understands JavaScript and JSON files. If you want to learn about the concepts behind it, you can read more in the output section. ![]() The output property has many more configurable features. In case you're wondering about the path module being imported at the top, it is a core Node.js module that gets used to manipulate file paths. In the example above, we use the output.filename and the output.path properties to tell webpack the name of our bundle and where we want it to be emitted to. resolve (_dirname, 'dist' ) ,įilename : '', }, } You can configure this part of the process by specifying an output field in your configuration: dist folder for any other generated file. dist/main.js for the main output file and to the. The output property tells webpack where to emit the bundles it creates and how to name these files. For example:Įntry : './path/to/my/entry/file.js', } tip src/index.js, but you can specify a different (or multiple) entry points by setting an entry property in the webpack configuration. Webpack will figure out which other modules and libraries that entry point depends on (directly and indirectly).īy default its value is.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |