Overriding Yarn sub-dependencies

Looking for a way to control sub-dependencies while using Yarn. In Gulp, this was easy as below:

  "name": "my-application",
  "dependencies": {
    "lodash": "latest"
  "overrides": {
    "lodash": {
      "main": "./dist/lodash.js"

Can someone tell me how this can be accomplished using Yarn?

With npm/yarn, you include your dependencies yourself instead.

So for example, at the top of your assets/scripts/main.js file you would do:

import 'lodash/dist/lodash';

(note the exclusion of .js)

and you’re good to go. :slight_smile:

You can see more about this on the sage-9 branch of the docs here under 3rd party packages.

1 Like

The problem is that I am doing this now but with NO @import for the css, only @import in main.js, and the css from the package is still getting pulled in and my build process is then failing. I would like to have the package EXCLUDE the css altogether and only pull the js. The package I am working with is pretty-checkbox.

Your example above was with lodash, and now you’re talking about a library called pretty-checkbox, which from my search, if I found the right one doesn’t have any JS at all.