DeLe
DeLe

Reputation: 2480

How to use emojionearea library in webpack

I try to using emojionearea with jquery in webpack like

import $ from 'jquery'
import emojione from 'emojione'

$('.class').emojioneArea({... })

I tested Jquery working well But when using emojioneArea that has error like

Uncaught TypeError: jquery__WEBPACK_IMPORTED_MODULE_1___default(...)(...).emojioneArea is not a function

How to make that working, thanks.

Upvotes: 1

Views: 245

Answers (1)

tmhao2005
tmhao2005

Reputation: 17504

According to the document, it looks like you import the wrong package name. It's supposed to be emojionearea instead of emojione. I think you also need to expose jquery in the global for other plugins too as following:

import $ from "jquery"
import 'emojionearea';

global.$ = global.jQuery = $;

$('.class').emojioneArea({ ... })

Upvotes: 1

Related Questions