Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webpack: How do I override package.json main field?

How can I override the main field of package.json like in bower?

"overrides": {
  "highcharts": {
    "main": "highcharts.js"
  }
}
like image 375
SooCheng Koh Avatar asked Mar 14 '16 14:03

SooCheng Koh


1 Answers

Try creating an alias with the same name as the module in your Webpack config.

module.exports = {
    ...
    resolve: {
        alias: {
            "highcharts": path.resolve(__dirname, "path/to/file")
        }
    },
    ...
};
like image 115
Joe Clay Avatar answered Oct 24 '22 04:10

Joe Clay