Hi all!
I trying plug html theme with bunch /css, /js files, according to doc i created client/compatibility folder in imports/startup and load them by import with the aim to control loading order, but get: Uncaught SyntaxError: Unexpected token import
please look this screenshot:
but no results, some functionality ( fade-in effect between images layers) don’t work, same as in client/compatibility (eagerly load) case. Developer of theme says:
Just make sure the scripts.js file is called last as it initialises the other plugins
in client/compatibility case i renamed scripts.js to main.js, but without result.
Also want to note, that in static HTML page case theme’s functionality works nice.
How can I accurately control, that the scripts.js file will be loaded last?
Any ideas?
thanks in advance
There are a couple of ways to do this. but the first mistake is that you try to load CSS inside a Javascript file.
create a css file and use css import statements in your specific order.
Maybe you can render the theme from server side and manually include them inside your script tags? I know you couldn’t do this in Meteor in the old days, but not sure if anything changed since then regarding server side rendering and code splitting.
In the old meteor files were loaded alphabetically but nowadays I guess you can control load order with import statements. your application needs to be structured this way though.