I'm using Noty version 3 https://github.com/needim/noty. According to the documentation I should use require or import.
import Noty from 'noty';
new Noty({
text: 'Notification text'
}).show();
// or
const Noty = require('noty');
new Noty({
text: 'Notification text'
}).show();
But none works. Even in the last version of Chrome.
When I'm using require:
Uncaught ReferenceError: require is not defined
And when import:
Uncaught SyntaxError: Unexpected token import
First, I don't agree with giving thumbs down to questions. I thought where was no such thing as a stupid question.
That said, you can definitely use
importorrequire. You're just going to have to use something like Browserify to make them work.If you really want to get that way, I've got a repo here that I just set up to try out Noty stuff