#Is it supposed to be possible to change the webpack config in a plugin?

10 messages · Page 1 of 1 (latest)

split stratus
#

I would like to add some items to resolve.alias but it doesn't seem to be affected:

admin: {
  ...incomingConfig.admin,

  webpack: (incoming) => {
    const incomingWebpack = incomingConfig.admin?.webpack || ((a) => a)
    const config = incomingWebpack(incoming)
    console.log('icmign applied')
    return {
      ...config,
      resolve: {
        ...config.resolve,
        alias: {
          ...config.resolve.alias,
          axios: false,
          'passport-oauth2': false,
          'express-session': false,
          passport: false,
        },
      },
    }
  },
},
balmy echo
#

Yes, absolutely you can do this

#

you can see an example of how we do it in the cloud storage plugin

#

each adapter is responsible for extending the Webpack config

#

you may need to rm -Rf node_modules/.cache to see changes

split stratus
#

I'm building an oAuth plugin, is it ok if I publish the source code?

#

I have also tried to add a sign in button by setting admin.components.beforeLogin but it doesn't seem to work.

#

Oh, just noticed what happened

#
export function oAuthPlugin(incoming: Config): Config {
  if (CLIENTSIDE) return incoming