Skip to content

Instantly share code, notes, and snippets.

@mikeqcp
Last active June 8, 2017 20:37
Show Gist options
  • Save mikeqcp/f7e4699ac5ff86f90e025cb425014068 to your computer and use it in GitHub Desktop.
Save mikeqcp/f7e4699ac5ff86f90e025cb425014068 to your computer and use it in GitHub Desktop.
Exercises for webpack devtalk - Apptension

Exercise 1

Prepare webpack configuration for project structure provided here: https://github.com/mikeqcp/webpack-exercise-apptension. Prepare config for dev and prod environments.

You can use webpack 2 if you want.

Configuration should include:

  • support for es6 (use babel)
  • correctly import all modules used in the app
  • compile scss styles
  • extract all css styles to a separate file
  • should create 2 bundles - one for main webpage, one for unsupported page
  • common.js module should be shared between both bundles
  • filenames should be hashed
  • support for browser-specific prefixes
  • automatically create html file during build
  • generate spritesheets from images in sprites directory + use one of generated icons in project
  • enviroment specific configs (env/local/conf.js & env/prod/conf.js) should be served when importing config module
  • PRODUCTION global variable should be defined, and set to true only for production (used in modules/log.js)
  • development enviromnent should support hot-reloading

Exercise 2

Write a plugin or loader. Include an example of it's usage.

Bonus points:

  • If is doesn't already exist
  • If it is usefull in real life
  • For variety and quality of used API hooks/capabilities
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment