Way to Extend Webpack Configuration

Hey there,

I’m currently figuring out how to integrate React Components written with jsx into a Vapid project to add some interactive suggar.
I’m aware that Vapid has a Webpack config builtin.

Is there any way of extending or customizing the webpack config on a project basis?

Cheers,
Felix

1 Like

Figured it out: It just needs babel-loader as webpack module in your webpack_config.js

        {
          test: /\.(js|jsx)$/,
          exclude: /node_modules/,
          use: {
            loader: "babel-loader"
          }
        }

and babel as dependency:

npm i @babel/core babel-loader

An you are good to go on the vapid cli level.

On a project basis developers are then enabled to set a babel preset in their .babelrc
like these presets for react:

{
    "presets": ["@babel/preset-env", "@babel/preset-react"]
}

I can do a merge request on your github repo if you want. But i’m open to discuss this here first!
What do you think?

Cheers,
F

2 Likes