FlashKeepers

JavaScript · JavaScript · College and University

JavaScript Modules and Bundlers Basics

ES module import and export syntax and the role of bundlers like Webpack and Vite in a modern JavaScript project.

About this set

29 basic cards for JavaScript JavaScript. It opens with "What does the 'export' keyword do in a JavaScript module?" and "How do you export a single value as the default export from a module?". More College and University decks are listed below.

29 cards · basic cards · AI-written, checked twice. Edit anything.

Study this set free Look inside first Get FlashKeepers for iPhone

Opens in your browser, no account. Get the iPhone and iPad app · Android app

What does the 'export' keyword do in a JavaScript module?
Show answerMakes a value (variable, function, or class) available to other modules that import it
How do you export a single value as the default export from a module?
Show answerUse 'export default' followed by the value
What is the syntax for importing a default export from a module?
Show answerimport name from "module-path"
How do you import a named export from a module?
Show answerimport { name } from "module-path"
What is the difference between default and named exports?
Show answerA module can have only one default export but can have multiple named exports
How do you import all exports from a module into a namespace object?
Show answerimport * as name from "module-path"
What is a bundler and why is it used in modern JavaScript projects?
Show answerA tool that combines multiple modules into one or more optimized files for deployment
What is Webpack?
Show answerA popular bundler that takes modules with dependencies and generates static assets
What is Vite?
Show answerA fast frontend build tool that uses native ES modules and optimized bundling for production
How does a bundler handle module dependencies?
Show answerIt resolves import statements, finds the required modules, and includes them in the output
What is code splitting and why is it important?
Show answerDividing code into chunks that load on demand, improving initial load performance
What is tree shaking in the context of bundlers?
Show answerRemoving unused code from the bundle to reduce file size
What file is used to configure how Webpack bundles a project?
Show answerwebpack.config.js
What is the purpose of a webpack.config.js file?
Show answerDefine entry points, output paths, loaders, plugins, and other bundling settings
What is the difference between development and production modes in bundlers?
Show answerDevelopment prioritizes fast rebuilds and debugging; production optimizes for size and performance

14 more cards in the app

Study this set free