Skip to content
Snippets Groups Projects
Unverified Commit e07ff45a authored by Matiss Janis Aboltins's avatar Matiss Janis Aboltins Committed by GitHub
Browse files

:fire: remove pikaday monkeypatch (#1203)

AFAIK with the build-script upgrades we have done - this monkeypatch is
no longer necessary. The build size still seems to be the same.
parent f41763b0
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ const { ...@@ -7,6 +7,7 @@ const {
override, override,
overrideDevServer, overrideDevServer,
} = require('customize-cra'); } = require('customize-cra');
const { IgnorePlugin } = require('webpack');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
if (process.env.CI) { if (process.env.CI) {
...@@ -35,6 +36,15 @@ module.exports = { ...@@ -35,6 +36,15 @@ module.exports = {
generateStatsFile: true, generateStatsFile: true,
}), }),
), ),
// Pikaday throws a warning if Moment.js is not installed however it doesn't
// actually require it to be installed. As we don't use Moment.js ourselves
// then we can just silence this warning.
addWebpackPlugin(
new IgnorePlugin({
contextRegExp: /moment$/,
resourceRegExp: /pikaday$/,
}),
),
config => { config => {
config.cache = false; config.cache = false;
return config; return config;
......
diff --git a/node_modules/pikaday/pikaday.js b/node_modules/pikaday/pikaday.js
index 8dae838..13ecfbe 100755
--- a/node_modules/pikaday/pikaday.js
+++ b/node_modules/pikaday/pikaday.js
@@ -12,8 +12,8 @@
if (typeof exports === 'object') {
// CommonJS module
// Load moment.js as an optional dependency
- try { moment = require('moment'); } catch (e) {}
- module.exports = factory(moment);
+ // try { moment = require('moment'); } catch (e) {}
+ module.exports = factory(null);
} else if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(function (req)
---
category: Maintenance
authors: [MatissJanis]
---
Remove `pikaday` monkeypatch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment