Skip to content

Commit

Permalink
Shim ICAL to prevent using the global object.
Browse files Browse the repository at this point in the history
The library ical.js heavily depends on instanceof checks which will break if
two separate versions of the library are used (e.g. bundled one and global
one).

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
  • Loading branch information
st3iny committed Nov 23, 2021
1 parent bfa60fb commit d0e6bb9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ webpackConfig.plugins.push(
pattern: './src/assets/iconfont/*.svg'
}
}),
new webpack.IgnorePlugin(/^\.\/locale(s)?$/, /(moment)$/)
new webpack.IgnorePlugin(/^\.\/locale(s)?$/, /(moment)$/),
new webpack.ProvidePlugin({
// Shim ICAL to prevent using the global object (window.ICAL).
// The library ical.js heavily depends on instanceof checks which will
// break if two separate versions of the library are used (e.g. bundled one
// and global one).
ICAL: 'ical.js',
}),
)

module.exports = webpackConfig

0 comments on commit d0e6bb9

Please sign in to comment.