Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Use .node extension for requiring native module
According to the [Node.js documentation][1] the file extension CAN be omitted but omitting it has the disadvantage that webpack can't match these modules. So if you try to package a JavaScript application which use node-canvas then you can't simply use webpack plugins like [node-native-loader][2]. With this little change webpack and the node-native-loader plugin can be used to easily create an application package with the canvas.node lib copied beside the packed JavaScript and everything works fine. [1]: https://nodejs.org/api/addons.html#addons_loading_addons_using_require [2]: https://www.npmjs.com/package/node-native-loader
- Loading branch information