Build Tools & Bundlers
The rival bundlers, transpilers and framework CLIs that turn source into shipped files, each with its own config, CLI and plugins. Interviewers ask which one fits a project and what leaving it costs.
on this pageshowhide
explore
- Bundling & Transpiling30 questions
- Module Graph & Resolution6 questions
- Transforms & Browser Targets6 questions
- Dev Servers & Hot Reload6 questions
- Source Maps6 questions
- Asset & Style Imports6 questions
- Vite36 questions
- Dev Server & HMR6 questions
- Dependency Pre-Bundling6 questions
- Configuration6 questions
- Plugin System6 questions
- Production Bundling6 questions
- Env Vars & Assets6 questions
- webpackempty
- Rollupempty
- Rolldownempty
- esbuildempty
- SWCempty
- Babelempty
- Parcelempty
- Angular CLI (has its own guide)32 questions
- Workspace File & Targets5 questions
- Generators & Schematics6 questions
- Builders & Dev Server6 questions
- Update Command & Migrations5 questions
- Library Projects5 questions
- Serve, Proxy & Deploy5 questions
- create-vue5 questions
questions
103 · 4 sectionsIn a web build, what does `import thumbUrl from './specimen-thumb.png'` give your code, and when does the bundler inline the image instead?
basics
~20 sThe import becomes a small generated module whose default export is a URL string pointing at a copy of the image the build emits. Files below a size threshold are often inlined instead, as a base64 data URL inside the importing file.
In a web dev server, what is hot module replacement, and how does it differ from a live reload of the page?
basics
~20 sHot module replacement swaps only the edited modules into the running page, so in-memory state such as a half-typed form can survive; a live reload requests the whole page again and re-runs every script, losing that state.
In a web build, what is a module graph, and how does a bundler build one starting from an entry point?
basics
~20 sA module graph is every file an app needs, linked by its imports. A bundler starts at each entry, resolves each specifier to one file, parses that file for further imports and repeats until no new file appears.
In a web build, what is a source map for, and how do browser developer tools find the map for a shipped file?
basics
~20 sA source map is a JSON file that maps positions in shipped, transformed code back to the original file, line, column and name. Developer tools find it through a sourceMappingURL comment at the end of the file or a SourceMap response header.
What separates syntax lowering from a polyfill in a web build, and which one fixes `stop?.platform` versus `departures.at(-1)` on an older browser?
basics
~20 sLowering rewrites newer syntax, such as optional chaining, into older equivalent code at build time; a polyfill ships runtime code that defines a missing built-in, such as Array.prototype.at. Neither can add an engine capability like Proxy.
In a Vite config file, what does `defineConfig` do, and how do you give `vite` and `vite build` different settings?
basics
~20 sdefineConfig only adds types for editor help and returns your config unchanged. To vary settings, export a function: Vite calls it with command ('serve' or 'build'), mode, isSsrBuild and isPreview, then uses the object it returns.
In a Vite app, why does `import.meta.env.DONATIONS_SIGNING_KEY` read `undefined` in the browser while `import.meta.env.VITE_API_ORIGIN` has a value?
basics
~10 sVite exposes on import.meta.env only variables whose names start with envPrefix, VITE_ by default, plus built-ins such as MODE, DEV, PROD, SSR and BASE_URL. Any other variable reads as undefined in client code.
When `vite` starts a Vite 8 dev server, why does it pre-bundle dependencies, and what happens to a CommonJS package and a many-module package?
basics
~20 sVite 8's dev server serves native ES modules, so it pre-bundles bare-imported dependencies with Rolldown: a CommonJS or UMD package is converted to ESM, and a package of hundreds of internal modules becomes one file fetched in one request.
In Vite 8, what does running `vite build` on a single-page app do by default, from the entry it reads to the files it writes?
basics
~20 svite build takes index.html as its entry, bundles the module graph with Rolldown, lowers and minifies JavaScript with Oxc and CSS with Lightning CSS, and writes content-hashed files into dist/assets, with no source maps unless build.sourcemap is set.
In a Vite 8 project whose tsconfig.json maps `@/*` to `src/*`, why do `@/` imports type-check yet fail to resolve, and what fixes it?
basics
~10 sTypeScript's paths only inform the type checker, and Vite 8 ignores them by default. Either declare resolve.alias with an absolute replacement, or set resolve.tsconfigPaths: true so Vite applies the tsconfig paths itself.
With the Angular CLI, how does `ng serve` differ from `ng build`, and why is the dev server's output never what you deploy?
basics
~20 sng serve runs the @angular/build:dev-server builder, which builds the app with its development configuration in memory, watches files and reloads the browser. ng build runs @angular/build:application with the production configuration and writes optimized, hashed files to dist/<project>/browser for deployment.
With the Angular CLI, what does `ng generate library` add to a workspace, and what must happen before an app in that workspace can import it?
basics
~20 sng generate library adds a library project under projects/ with its own ng-packagr build target, ng-package.json, package.json and public-api.ts, and maps the library name to dist/<name> in tsconfig paths. Apps import the built output, so build the library first.
With the Angular CLI, what does `ng generate component` create in a v22 project, and how do you preview it before any file is written?
basics
~10 sng generate component user-card runs the @schematics/angular:component schematic, which creates a user-card/ folder with user-card.ts, .html, .css and .spec.ts for a standalone UserCard class; --dry-run (-d) lists those files without writing them.
With the Angular CLI's `ng serve`, how do you forward `/api` requests to a backend running locally on another port, and why does that not help in production?
basics
~20 sCreate a proxy file such as src/proxy.conf.json mapping /api/** to the backend's target URL, set proxyConfig on the serve target, and restart ng serve. Only the dev server reads it, so production needs its own reverse proxy or CORS.
With the Angular CLI, what does `ng update @angular/core @angular/cli` do beyond changing version numbers in package.json?
basics
~20 sng update resolves compatible target versions for the named packages and their package groups, checks peer dependencies, requires a clean git tree, rewrites package.json, installs, then runs each updated package's migration schematics to change your code and configuration.
How do you start a new Vue 3 project with create-vue, and why must the command be npm create vue@latest rather than npm create vue?
basics
~10 sRun npm create vue@latest, answer the prompts, then install dependencies and start the dev server. The @latest tag matters because without it npm may reuse a cached, outdated create-vue.
In create-vue 3.24, what does selecting ESLint generate, why is Oxlint always added with it, and how does the Prettier choice fit in?
basics
~20 sESLint adds a flat eslint.config with the Vue and TypeScript presets, plus Oxlint with an .oxlintrc.json; the lint script runs both. Oxlint is always included and eslint-plugin-oxlint turns off ESLint rules it covers. Prettier adds its own config and a format script.
When scaffolding an internal tool with create-vue, what do the TypeScript, Router, Pinia and Vitest choices each add to the generated project?
basics
~20 sTypeScript adds tsconfig files, env.d.ts and a type-checking build script; Router adds vue-router with src/router and two views; Pinia adds pinia and a counter store; Vitest adds vitest.config, a jsdom test setup and an example spec.
How do you run create-vue non-interactively from a script or CI job, and which prompts can still appear even when you pass feature flags?
basics
~20 sPass a directory and feature flags after --, as in npm create vue@latest admin-tool -- --ts --router --pinia --vitest. Any feature flag skips the feature prompts, but a missing directory, a non-empty folder without --force or an invalid package name still prompts.
In a create-vue TypeScript project, why does tsconfig.json list no files but reference tsconfig.app, tsconfig.node and tsconfig.vitest, and what does npm run build run?
basics
~20 sThe root tsconfig.json only references separate projects: app code for the browser, tool configs for Node, and tests for jsdom, each with its own globals. npm run build runs vue-tsc --build and vite build in parallel.