Skip to content

Commit

Permalink
Merge pull request #533 from nextcloud-libraries/fix/nextcloud-moment…
Browse files Browse the repository at this point in the history
…-compatibility
  • Loading branch information
skjnldsv committed Jan 24, 2024
2 parents 84bc123 + 0b9078a commit acaa161
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ module.exports = {
// Make appName & appVersion available as a constant
new webpack.DefinePlugin({ appName: JSON.stringify(appName) }),
new webpack.DefinePlugin({ appVersion: JSON.stringify(appVersion) }),

// @nextcloud/moment since v1.3.0 uses `moment/min/moment-with-locales.js`
// Which works only in Node.js and is not compatible with Webpack bundling
// It has an unused function `localLocale` that requires locales by invalid relative path `./locale`
// Though it is not used, Webpack tries to resolve it with `require.context` and fails
new webpack.IgnorePlugin({
resourceRegExp: /^\.\/locale$/,
contextRegExp: /moment\/min$/,
}),
],

resolve: {
Expand Down

0 comments on commit acaa161

Please sign in to comment.