If I'm using webpack or browserify, what's the exact process to be able to import only the necessary modules from jQuery that are listed here?
import {core, dimensions} from 'jquery'
doesn't work.
If I'm using webpack or browserify, what's the exact process to be able to import only the necessary modules from jQuery that are listed here?
import {core, dimensions} from 'jquery'
doesn't work.
You can import modules from jQuery's src directory, like so:
import core from 'jquery/src/core';
import dimensions from 'jquery/src/dimensions';
The jQuery sources use asynchronous module definitions to load modules internally (AMD), so you have to use a module bundler to use it. Webpack would be a good choice for this, it supports AMD out of the box.