For now, you need to have the pre-release version installed for DX:
sfdx plugins:install salesforcedx@pre-release
Make sure you've also updated all extensions, including Lightning Web Components, which is not currently part of the Salesforce Extension Pack.
Often, simply restarting after installing/updating all extensions and the pre-release sfdx plugin will automatically create the lwc folder for you. You may also need to close and re-open the folder for it to take effect. I'm not sure how/why my lwc folder appeared, but it wasn't obvious as to what I did.
If all else fails, create a new project in a new, empty directory, and copy the lwc folder back into force-app/main/default/
, so that it has two files:
./force-app/main/default/lwc/.eslintrc.json
./force-app/main/default/lwc/jsconfig.json
Once you've done that, you'll stop getting that error and be able to create new components. These config files may require modification if you copy from a new project, so make sure you check the file paths of jsconfig.json. Every time you create a new component with sfdx, jsconfig.json will be updated with more metadata, so make sure you commit this file if you're using a repo.
NOTE: Even though you'll be able to create files locally, to push to the server, you need a pre-release org for now, since all new LWC features are tied to API 45.0 and later, while all production and scratch orgs will be 44.0.
Edit (2019-05-30): LWC is now open source! https://github.com/salesforce/lwc
Our intent is to open source LWC by the end of the year but it will ultimately come down to resourcing constraints because there's still a lot of work to do!
There's not too much going on in the lwc
module. There's basically LightningElement
which exposes an API subset of HTMLElement
(what we consider the "good parts"). There are also the various decorators (api
, track
, readonly
, wire
) and several other APIs that are only usable by our compiler.
To answer your question though, a single file would be the simplest type of module, but a module can contain multiple files since we are able to import and export in the same file. You can event do that with a single line using module redirects.
Best Answer
In your .html file
bears
must be replaced bybears.data
.