I’m trying to use Chroma library in Magento and so far I did the following two things:
- Created a app/design/frontend/Vendor/Theme/requirejs-config.js with the following content:
var config = {
deps: [
'js/chroma.min',
'js/_sample',
]
};
and a _sample.js file in app/design/frontend/Vendor/Theme/web/js/_sample.js
with the following code:
chromaColor = chroma.random();
A pretty straightforward and simple thing to do, but in the browser while both scripts load just fine, _sample.js throws this error: Can’t find variable: chroma.
Somehow my _sample.js just doesn’t seem to have access to the Chroma library? Or is it something else? Am I including those files wrong?