Skip to content

chrisvfritz/maintainable-webpack-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maintainable Webpack Config

Wepack configurations can quickly grow complex. That's annoying in individual projects, but when maintaining a popular template, accidentally introducing a regression might cost thousands of developers hours of troubleshooting. This project is an experiment - an attempt to make all of it testable. I'd like to provide:

Robustness through tests and validation

Robustness is ensured by:

  • providing tests for every feature of the build process
  • validating all provided options through a custom validator
  • validating the final produced config through webpack-validator

Plenty of escape hatches to extend the config

var path = require('path')

module.exports = buildConfig({
  // ...
  webpack: {
    // provide additional and overriding webpack options
    plugins: new MySpecialPlugin(),
    mySpecialPluginOptions: {
      foo: 'bar'
    }
  },
  schemaWhitelist: {
    mySpecialPluginOptions: true
  }
})

A simple interface for opinionated setups

I honestly don't know how I want this to look yet. Maybe like this?

var path = require('path')

module.exports = buildConfig({
  folderStructure: {
    src: {
      root: path.join(__dirname, 'src')
    },
    dist: {
      root: path.join(__dirname, 'dist'),
      assets: path.join(__dirname, 'dist/assets')
    }
  },
  env: 'production',
  features: {
    gzip: true
  }
})

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages