Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add moment.js to boilerplate or a similar framework #1316

Closed
kopax opened this issue Dec 7, 2016 · 3 comments
Closed

Add moment.js to boilerplate or a similar framework #1316

kopax opened this issue Dec 7, 2016 · 3 comments

Comments

@kopax
Copy link

kopax commented Dec 7, 2016

What are you users using as date library ?

I am using moment.js but the installation step instruction for webpack isn't clear enough.

I did like recommended here

I was hesitating between adding this either to webpack.base or webpack.dev.

new webpack.ContextReplacementPlugin(/\.\/locale$/, 'empty-module', false, /js$/)

I assume the build prod doesn't need to import anything anymore and this should be added only to dev configuration am I right ? Or is it required to be in the build prod ?

Also, I am trying to figure out how to configure locale in order to work with the

@kopax kopax changed the title Add moment.js to boilerplate or something similar Add moment.js to boilerplate or a similar framework Dec 7, 2016
@DJTB
Copy link

DJTB commented Dec 8, 2016

I modified webpack.base with:

 resolve: {
      modules: ['app', 'node_modules'],
 +    alias: { moment: 'moment/moment.js' }, // reference proper moment js

However, I later removed moment and decided to use date-fns since it's immutable, plays nicely with webpack, and can be tree-shaken.

@mxstbr
Copy link
Member

mxstbr commented Dec 8, 2016

Yeah I use date-fns, seems to be much more modern and made for this purpose!

@mxstbr mxstbr closed this as completed Dec 8, 2016
@lock
Copy link

lock bot commented May 29, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants