I think the documentation completely misses the case when you want to import an extra es6 module from another component bundle. Example, suppose we have the following folder structure.
- lwc
- module1
- module1.html
- module1.js
- module1-extra.js
- module2
- module2.html
- module2.js
How to import module1-extra.js into module2.js ?
I tried
import {class1] from 'c/module1'
import {class1] from 'c/module1/module1-extra'
both aproaches failed.
Best Answer
On the Salesforce platform, you can't import a specific file from another module. You can only import the entry file.
If you want
module2.js
to import some value exported bymodule1-extra.js
this value has to be re-exported in the module entry point.