Skip to content

Commit

Permalink
Fix undefined default export.
Browse files Browse the repository at this point in the history
Tell Webpack to that this is a library.

This fixes the following error when calling `printJS()` after importing it via `import printJS from 'print-js'`:
> TypeError: __WEBPACK_IMPORTED_MODULE_2_print_js___default(...) is not a function
  • Loading branch information
gabrieldeal committed Sep 18, 2018
1 parent dbf3ffb commit 638ce48
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ module.exports = {
'./src/index.js'
],
output: {
library: 'printJs',
libraryTarget: 'umd',
path: path.resolve(__dirname, 'dist'),
filename: 'print.js',
sourceMapFilename: 'print.map'
Expand Down

0 comments on commit 638ce48

Please sign in to comment.