Load a library globally to a project after using yarn add
See original GitHub issueHello,
What’s the proper way to load a library (GSAP & scrollmagic in my case) after adding them using yarn add 'libraryName'
.
I managed to import Jquery by using provide
in task-config.js, still, I’m not sure what’s the proper way to import a different library including its plugins.
An example would be greatly appreciated.
Thanks
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6 (1 by maintainers)
Top Results From Across the Web
yarn global
Note: Unlike the --global flag in npm, global is a command which must immediately follow yarn . Entering yarn add global package-name will...
Read more >How To Install and Use the Yarn Package Manager for Node.js
First you install the yarn command globally, then you use the global yarn command to install a specific local version of Yarn into...
Read more >How to install a list of many global packages with Yarn
Make sure that you already have Node installed on your system. Using this above command the yarn packages can be installed globally. Note...
Read more >How to use local Node packages as project dependencies
There are npm add relative/path and yarn add file:relative/path , which copy the package directory over to the project's node_modules. The npm ...
Read more >Extending with Shared Libraries - Jenkins
Since these libraries will be globally usable, any Pipeline in the system can utilize ... would load a library using the same SCM...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed up!
Solution: Disable AMD
More info: https://github.com/webpack-contrib/imports-loader, https://webpack.js.org/loaders/imports-loader/#webpack-config-js and https://github.com/janpaepke/ScrollMagic/issues/665#issuecomment-323344772
Disable AMD
There are many modules that check for a define function before using CommonJS. Since webpack is capable of both, they default to AMD in this case, which can be a problem if the implementation is quirky.
Then you can easily disable the AMD path by writing
@farissi Did you get it to work? I’ve been going crazy for a week and nothing…