Updates for stencil storybook babel #729
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In my opening comment in PR #711, I mentioned a caveat that this PR resolves.
Although the Stencil issue/feature I mentioned in a source code comment for that PR is still open, I recently discovered that Babel was not configured to prevent tree shaking which was removing Stencil's
h
module. SettingonlyRemoveTypeImports
totrue
in Babel config file preventsh
module from being removed.In addition, Babel 7 config file (.babelrc.json) is now deployed for new Stencil Storybook projects. This is for Babel project level adjustments if needed. In order for this to work, babel-loader for Webpack is required to have the following option property:
rootMode: 'upward'
. This property, when config files are being used, can only be set during runtime. This PR programmatically sets that when the root '.storybook/main.ts' file is being processed.Make edits and please ask for any clarification if needed.
Prior to executing the script below if you choose, run verdaccio locally and: clone, build and publish (
/dist/packages/stencil
package) with semver version of choice. Below I used14.0.3-local.1
. This script is a smoke test that I used and should launch Storybook with a single story generated.