问题
I'm using Gulp and Browserify for my build process, except I'm having trouble using third party jQuery plugins – showing error jQuery is not defined
The following is my file structure.
app.js
import $ from 'jquery'
import plugin from 'jquery-plugin'
jquery-plugin.js
(function($) {
// Plugin code here
}(jQuery));
Any ideas?
回答1:
Maybe you need use './'
import $ from 'jquery'
import plugin from './jquery-plugin'
EDITED, my new answer below:
Try this way:
import * as jqueryPlugin from 'jquery-plugin'
来源:https://stackoverflow.com/questions/35894687/es6-import-jquery-is-not-defined