Search code examples
reactjswebpack-2

what do we use to define externals in webpack2?


I am trying to migrate an existing project from webpack 1 to webpack 2, I have been able to do it for the most part but not sure how we define externals in webpack 2.


Solution

  • It's very simple to use official doc paragraph Externals:

    Example from doc:

    externals : {
      lodash : {
        commonjs: "lodash",
        amd: "lodash",
        root: "_" // indicates global variable
      }
    }