Hello all. I’m new to Sage and I’m having some JS issues. I’m trying to use the GSAP package. I have it installed through both npm and Bower (I’ve been trying everything to get this to work). I have a file called app.js
located in the assets/scripts/
directory that contains the following:
import { TweenMax, TimelineMax } from "gsap";
var tl = new TimelineMax({
delay: 0.25,
repeat: -1
});
var windowContents = document.getElementById("window_content");
var duration = 10;
var content_to = {
y: -80
};
tl.staggerTo(windowContents, duration, content_to, 0.25 );
additionally, my manifest.json
file looks like this:
{
"dependencies": {
"main.js": {
"files": [
"scripts/app.js",
"scripts/main.js"
],
"main": true
},
"main.css": {
"files": [
"styles/main.scss"
],
"main": true
},
"customizer.js": {
"files": [
"scripts/customizer.js"
]
},
"jquery.js": {
"bower": ["jquery"]
}
},
"config": {
"devUrl": "http://ajschmidt.dev"
}
}
This code returns the following Gulp error:
It looks like Uglify has an issue with the first bracket {
on the import statement in my app.js
file. I’m not sure how to fix this. I’ve tried a million things, including installing babel
and the es2015
preset. This didn’t seem to resolve the issue (though it is possible that I may not have set it up correctly). Any suggestions? Thanks in advance.