Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Configuring Webpack

HardPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Configuring Webpack. Start with the requirements on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

How would you configure Webpack for a modern front-end application?

Implement configure_webpack(options) to generate a deterministic configuration object. Support JavaScript, optional TypeScript and CSS handling, asset loading, production optimization, plugin selection, source maps, and an optional development server.

Input is a dictionary matching the options in the examples. Return a dictionary representing the Webpack configuration.

Constraints

  • options is a dictionary containing all keys shown in the examples
  • mode is either "development" or "production"
  • entry and public_path are non-empty strings
  • use_typescript, use_css, extract_css, analyze, and dev_server are booleans
  • The returned configuration must be deterministic and contain no environment-specific values

Function Signature

def configure_webpack(options):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output