How to add a js file with webpack?

前端 未结 2 1371
梦谈多话
梦谈多话 2021-01-11 10:09

I was reading this webpack tutorial:

https://webpack.github.io/docs/usage.html

It says it bundles the src files and node_modules. If I want to add another .j

2条回答
  •  醉梦人生
    2021-01-11 10:23

    The start point for code is the entry field in config. In your config entry point is the list of files. Webpack gets all, resolve their dependencies and output in one file.

    You have two options for adding third party script:

    • add the file path to entry list before app.js
    • require this file from app.js

提交回复
热议问题