unexpected modifying of the *.js by webpack

前端 未结 1 1866
谎友^
谎友^ 2021-01-26 02:52

I\'m new to webpack and similar tools. I wanted to reorganize my project. Currently all my JS-code lives in App.js. So before splitting it into modules and improving, I wanted j

1条回答
  •  故里飘歌
    2021-01-26 03:28

    Webpack wraps all code in an IIFE, for more predictable behavior and to avoid global pollution, among other things. In the bundled code, the place where your module's functions are defined is not the top level of the

提交回复
热议问题