Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(vite): iterate over .ts files in all directories #5553

Merged
merged 1 commit into from
May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,33 @@ const SCOPE_VERSION = JSON.stringify(versionHash)

// Entry points which we build using vite
const entryPoints = {
...globSync('src/components/*/index.js').reduce((acc, item) => {
...globSync(['src/components/*/index.js', 'src/components/*/index.ts']).reduce((acc, item) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't [jt]s also work here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should work, according to docs: https://github.com/isaacs/node-glob#glob-primer

Error: No changes found in backport branch

But next branch already contains these changes in the same array format, so good for now, I'd say

const name = item
.replace('/index.js', '')
.replace(/\/index\.[jt]s/, '')
.replace('src/components/', 'Components/')
acc[name] = join(__dirname, item)
return acc
}, {}),

...globSync('src/directives/*/index.js').reduce((acc, item) => {
...globSync(['src/directives/*/index.js', 'src/directives/*/index.ts']).reduce((acc, item) => {
const name = item
.replace('/index.js', '')
.replace(/\/index\.[jt]s/, '')
.replace('src/directives/', 'Directives/')
acc[name] = join(__dirname, item)
return acc
}, {}),

...globSync('src/functions/*/index.js').reduce((acc, item) => {
...globSync(['src/functions/*/index.js', 'src/functions/*/index.ts']).reduce((acc, item) => {
const name = item
.replace('/index.js', '')
.replace(/\/index\.[jt]s/, '')
.replace('src/functions/', 'Functions/')
acc[name] = join(__dirname, item)
return acc
}, {}),

...globSync('src/mixins/*/index.js').reduce((acc, item) => {
...globSync(['src/mixins/*/index.js', 'src/mixins/*/index.ts']).reduce((acc, item) => {
const name = item
.replace('/index.js', '')
.replace(/\/index\.[jt]s/, '')
.replace('src/mixins/', 'Mixins/')
acc[name] = join(__dirname, item)
return acc
Expand Down