Open RuchiJadon opened 4 years ago
If you are using webpack: you must register moment via ProvidePlugin to make it available.
@schugabe Could you provide an example? Thanks
I use webpacker (with rails) and this is my config. I don't know how this would work without rails/webpacker.
const { environment } = require('@rails/webpacker');
const webpack = require('webpack');
environment.plugins.prepend('Provide',
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
moment: 'moment',
Popper: 'popper.js'
})
);
module.exports = environment;
Thank you!
Just to know, if I use webpack.ProvidePlugin
, the deps will be provided to the code using it through window
, but in the end e.g. jQuery
or moment
won't be set to the global window
object in the final Webpack bundle, correct?
I have been struggling with this error for long. Can anyone help me with this? I have all the dependencies installed. This is in AngularJs application. All prerequisites are already installed like - moment, jquery, tempusdominus-core, moment-timezone.