Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(validation): update module location suggestion (#3508)
this commit fixes the module directory suggestion for the `dist-custom-elements` output target. in 47c4ccb, we introduced a bug where we assumed that the output target's `dir` field did not include a 'components' sub-directory. however, this is not the case, as we add 'components' to the `dir` field at the time of validating the output target. by removing 'components' from the directory in this commit, we use the value that is stored in `dir` as the source of truth this commit moves the check for the `dist-custom-elements` output target to occur after the `dist` output target check. this results in the validation for the `module` field in `package.json` giving higher precedence to the `dist` output target. this change was made for two reasons: 1. it aligns with the current output of the stencil-component-starter, which includes both output targets in its stencil config file - [the current module field is set for `dist`](https://github.com/ionic-team/stencil-component-starter/blob/ac43cfcaa46e79e7ad125a13dfbf58a2fd4b3350/package.json#L6) - [both `dist` and `dist-custom-elements` are set](https://github.com/ionic-team/stencil-component-starter/blob/ac43cfcaa46e79e7ad125a13dfbf58a2fd4b3350/stencil.config.ts#L6-L12) 2. it (temporarily) avoids complicating the logic of validating the `module` filed when there is more than one output target (by restoring the original behavior) the latter point will be covered in a future task to be completed by the stencil team. that work was deferred for now in an attempt to avoid rushing through a design in order to get this bug fix out the door
- Loading branch information