RetailMeNotSandbox/roux

create API that generates webpack configs for apps + roux

Closed this issue · 3 comments

Create an API that is a function that takes a Roux config object with the additional config property named webpackEntryIngredients [TBD name] that is an array of objects.

Each object has a glob property {string}, and an entryPoint property {string} that specifies the ingredient and the entrypoint within the ingredient that will generate the webpack entry.

Or it can specify a string that is a shortcut for the glob with that string and the entry point of javascript.

This function returns a webpack config instance.

Example:

module.exports = rouxConfig = require('@rmn/roux-webpack')({
    /* roux config goes here */
    webpackEntryIngredients: [
        '@rmn/example/page/*',
        {
            glob: 'pantry/**/*',
            entryPoint: 'preview'
        }
    ]
})
  • possibly rename webpackEntryIngredients if we can come up with something better

There is significant work to be done aside from writing the code to automatically generate the entry map for webpack. For now, I am going to create this module to encapsulate everything related to a roux webpack build but NOT generating the entry maps. As of v1 of this module, doing so will still be the responsibility of the consuming repo.

Once we determine the best path forward for #22, we can circle back to adding entry map generating functionality to the roux-webpack-config package.

My understanding of this issue is that its effectively a dupe of RetailMeNotSandbox/roux-webpack-config#1, the resolution of which was to not open source code for generating a webpack config just yet.

See https://github.com/RetailMeNotSandbox/roux-webpack-config/issues/8 for an understanding of the future of this feature.