6

I'm using inferno js with typescript (using ts-loader and transformInferno in webpack3) and mostly it's working well. However when running within the webpack-dev-server inferno outputs You are running production build of Inferno in development mode. Use dev:module entry point. in the browser conosole.

Whilst I can see that inferno has a dev:module entry defined in the package.json I don't understand how to use this entry point rather than the default module?

Rob Bacon
  • 63
  • 1
  • 5

1 Answers1

5

Registering an alias in webpack should do the trick. Like this:

resolve: {
    alias: {
        'inferno': 'inferno/dist/index.dev.esm.js',
    },
},

You can then add a condition to point to the non-dev one if you are running in production mode or not.

Keraf
  • 66
  • 1
  • 3
  • on rollup use alias plugin –  Feb 19 '21 at 15:42
  • 2
    Use this to choose between dev and prod -> `'inferno': (process.env.NODE_ENV !== 'production') ? 'inferno/dist/index.dev.esm.js' : 'inferno/dist/index.esm.js'` – Gal Bracha May 26 '22 at 09:34