nuxt-community / moment-module

Efficient Moment.js integration for Nuxt
MIT License
195 stars 12 forks source link

Webpack dependency at runtime. #30

Closed blowsie closed 5 years ago

blowsie commented 5 years ago

I am unable to use this module in production with nuxt-start becuase the module uses moment-locales-webpack-plugin.

moment-locales-webpack-plugin requires webpack, which is a build time dependency rather than a runtime dependency.

As a result, when I use npm install --production & nuxt-start this module fails since webpack is not available.

How can this issue be addressed?
Is the dependency this way by design? Perhaps using this in production hadn't been considered?

bart commented 5 years ago

Exact same issue here. Any solution?

blowsie commented 5 years ago

Nope, not as of yet, I asked in the nuxt discord and the majority of people just said to use https://date-fns.org/. Not really the answer i was looking for but its an option at least.

bart commented 5 years ago

What I did for the time beeing is added webpack to package.json via npm install webpack --save

pi0 commented 5 years ago

Using the latest nuxt, you can simply add this module to the buildModules (instead of modules) in nuxt.config.js. I'll update README as well :)