0

I'm learning about ES6 Modules and Webpack things, but I still didn't quite understand something from these things.

  1. When we should or shouldn't use it?
  2. Is it good to have massive tons of files and link them with export import?
  3. What is a good practice for me to understand it better?

I appreciate any kind of response, thanks before.

1 Answer 1

1

I think I have something to share with you inline:

When we should or shouldn't use it?

esmodule is also known as esnext which is the next version of Javascript which means you should use it. Regarding to webpack, it's a powerful tool to not only build the js code to run against browser but also combine your assets together (images/fonts/...) so that it can work together. In short, it would take around 5mins to build a webapp as write code as esm style + use webpack to build code run for browser.

Is it good to have massive tons of files and link them with export import?

This is how are modules working so there's no issue why doing that. It would be even easier to manage and test a module if you keep it small. In short, no problem for multiple files with import/export at all.

What is a good practice for me to understand it better?

There are hundreds of document regarding to esnext + webpack if you search for them. Visiting the official website to read is also a good way to go.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.