Skip to content

Commit

Permalink
fix: Correctly build node-fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
ptbrowne committed Jul 21, 2020
1 parent fcefd8b commit 448fa2c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/webpack.target.services.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ module.exports = {

resolve: {
alias: {
// We are building with target: node as webpack options. This causes webpack
// to consider the "module" entrypoint from node-fetch. This does not work properly
// as require('node-fetch') returns a module object (with the default property).
// Here, we force the resolution to take the commonJS file.
// TODO See if it is necessary to integrate in cozy-scripts
'node-fetch': 'node-fetch/lib/index.js',
// Unminified Handlebars uses `require.extensions` and this causes
// warnings on Webpack. We should think of a way to precompile
// our Handlebars template. At the moment it is not possible
Expand Down

0 comments on commit 448fa2c

Please sign in to comment.