Open alex996 opened 6 years ago
Tried import 'moment-holiday'
, it seems to work sparingly, depending on the webpack config. Any clues?
Plus one for this. I'm trying to use this with react, won't work, getting lots of web pack related errors.
Seeing this as well...
Hey, this seems to be a huge problem for us using react can you please show us how to fix this. Thanks
Running into this too. Great library, but can't use it due to incompatibility with Webpack.
Also ran into this trying to use in React App.
Is there a workaround?
Cant import
Workaround is to go to node-modules (moment-holiday folder, file:moment-holiday.min.js) and replace:
“undefined”==typeof require||nul===require||require.amd?this.moment:require(“moment”)
with this line:
require("moment")
@anetk we don't really want to modify node_modules as most of the time we delete this before we commit js projects
@kgrosvenor Fork the .min
file to your project then, so you can fix the require
s there.
I have created a fork that is usable via webpack: https://github.com/joeldenning/moment-holiday.
Installation:
npm install --save https://github.com/joeldenning/moment-holiday\#1.5.2-webpack.0
@joeldenning thanks for the fork! Also you may want to update your documentation to:
yarn add joeldenning/moment-holiday\#1.5.2-webpack.0
per https://github.com/yarnpkg/yarn/issues/2083#issuecomment-525335592
Cheers!
The package cannot be imported in a Webpack setup:
import moment from 'moment-holiday
yieldsError: Cannot find module "."
. Arequire
calls does not succeed either. Could you add support for Webpack?P.S. Originally discovered in the context of
create-react-app
.