Comments (12)
Plus one for this. I'm trying to use this with react, won't work, getting lots of web pack related errors.
from moment-holiday.
Seeing this as well...
from moment-holiday.
Hey, this seems to be a huge problem for us using react can you please show us how to fix this. Thanks
from moment-holiday.
@Anetk we don't really want to modify node_modules as most of the time we delete this before we commit js projects
from moment-holiday.
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
from moment-holiday.
Tried import 'moment-holiday'
, it seems to work sparingly, depending on the webpack config. Any clues?
from moment-holiday.
Running into this too. Great library, but can't use it due to incompatibility with Webpack.
from moment-holiday.
Also ran into this trying to use in React App.
Is there a workaround?
from moment-holiday.
Cant import
from moment-holiday.
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")
from moment-holiday.
@kgrosvenor Fork the .min
file to your project then, so you can fix the require
s there.
from moment-holiday.
@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 yarnpkg/yarn#2083 (comment)
Cheers!
from moment-holiday.
Related Issues (12)
- minification (?) causes error in gulp build process HOT 3
- NodeJs: Regions is not defined (in strict_mode) HOT 5
- Calculates Day After Thanksgiving incorrectly for 2019 HOT 6
- modifyHolidays.set() only works on server side HOT 2
- broken? HOT 2
- some issue using this in angular HOT 5
- Incorrect Date for Canadian Thanksgiving
- Add support for French public holidays HOT 1
- add International Women's Day
- TypeError: Cannot read property 'fn' of undefined
- isHoliday() doesn't work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moment-holiday.