Use Rollup to bundle your ES6 modules into single app.js
Module A
export const ModuleAConfig = {
a: 'a',
b: 'b'
};
export const ModuleA = {
Config: ModuleAConfig,
init(node) {
...
},
...
};
app.js:
import { ModuleA, ModuleAConfig } from './components/ModuleA';
Object.assign(ModuleAConfig, {
a: 'newA',
b: 'newB'
});
ModuleA.init();
You can find more examples in BunnyJS src or any ES6 library. If you will have any questions about Vanilla JS/ES6 architecture, let me know by mentioning with @.