Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何解決 JavaScript 中與多檔案互相交互相依問題 #20

Open
mvpdw06 opened this issue Apr 26, 2017 · 0 comments
Open

如何解決 JavaScript 中與多檔案互相交互相依問題 #20

mvpdw06 opened this issue Apr 26, 2017 · 0 comments

Comments

@mvpdw06
Copy link
Owner

mvpdw06 commented Apr 26, 2017

問題

假設 A.js 用到了 B.js 中的 function 或是 object,但 B.js 中也用到了 A.js 中的 function 或 object,但要 bundle 起來!

解法

把這些 js 攤平為一隻 js, 打包成為一隻 bundle.js

  1. gulp task
  2. webpack 利用 multi entry point 加入
entry: [
  'src/A.js',
  'src/B.js',
  'src/C.js',
...
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant