Search code examples
react-starter-kit

Build System of React-starter-kit


I found the same question in stackOverflow unanswered: Different main entry point in package.json for node and browser.

I just want to know how this configuration is done. How to specify different entries for different build targets in package.json?

enter image description here


Solution

  • It seems that I have the answer.

    https://webpack.github.io/docs/configuration.html#target

    I can't find any documentation about this, but when you set the Target as 'node', the file required Will be the one from 'main' entry, if you set Target as 'web', the file from 'browser' entry will be required.