Considering the following where both the importer and a module use another module:
main.js
:
export class Main {
static func1() {}
static func2() {}
static func3() {}
}
one.js
:
import { Main } from './main.js';
export { one };
// one also uses some methods in Main.
background.js
:
import { Main } from './main.js';
import { one } from './one.js';
Would it be better if the process is done as a re-export?
main.js
:
export class Main {
static func1() {}
static func2() {}
static func3() {}
}
one.js
:
import { Main } from './main.js';
export { one, Main };
// one also uses some methods in Main.
background.js
:
import { one, Main } from './one.js';
First one is easier to read. Are there any performance concerns?