I use dynamic import as this:
import('./myfile.js').then(function() {
// do awful stuff
});
But is it possible to do dynamic dynamic import ?
const str = './myfile.js';
import(str).then(function() {
// do awful stuff
});
in standard js, I think so, but not in Meteor, as it has no way to know which file must be in the “compiled” bundle.
How to tell Meteor that the file ‘myfile.js’ must be in the bundle and keep the dynamic aspect of the import ?
Adding it in the client with api.add_files is not dynamic.
I tried to insert it on the server, but to no avail
api.add_files([
'./myfile.js',
], ['server']);