Skip to content

POC that webpack treeshaking will drop moment locale files in production

Notifications You must be signed in to change notification settings

laurenskling/moment-treeshaking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

intro

this package is created for a discussion at webpack/webpack#3128 about momentJS it's locale files being bundled in webpack.

project

npm run dev starts the dev server at localhost:8000, you'll see the dutch date.

Running npm run build and opening the index.html will give you the english date, although we've set locale to nl.

If you unquote // import 'moment/locale/nl'; and run build again, the dutch locale will have been included.

If you ask me, Webpack 2 treeshaking is dropping all the unused code, including all locale files.

About

POC that webpack treeshaking will drop moment locale files in production

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published