I am trying to add an animation library called Sal, built on pure Javascript (Does not rely on jQuery). Maybe I am missing something, but I followed the instructions on adding via require-config, and I am getting a sal is not defined error.
I have also tried just adding the js file via default_head_blocks.xml
My require-config.js
var config = {
paths: {
'sal': 'js/sal'
},
deps: [
"js/script",
"js/main"
]
};
My main.js
define(['sal'], function(){
"use strict";
sal();
console.log(" ====== main.js is loaded====== ");
});
VENDOR/themename/require-config.jsVENDOR/themename/web/js/sal.jsVENDOR/themename/web/js/script.js(Contains other JS unrelated to Sal)VENDOR/themename/web/js/main.js(Contains my JS and trying to initialize Sal inside) For context, I also importing a slider named Flickity, and it works fine (I didn't include it in my initial example)