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

Fix transformation issue of 'require' #26

Merged
merged 2 commits into from
Feb 17, 2022

Conversation

MartinKolbAtWork
Copy link
Contributor

Fix proposal for issue #25

package.json Outdated Show resolved Hide resolved
@flyfishzy flyfishzy merged commit 70ae949 into originjs:main Feb 17, 2022
@ghost
Copy link

ghost commented Jun 23, 2023

This broke our code (webpack originally, but also using vite):

const messagesDE = {
  ...require('./i18n/de'),
  ...require('./i18n/errorcodes_de.json'),
  ...require('./i18n/requeststatus_de.json'),
}
const messagesEN = {
  ...require('./i18n/en'),
  ...require('./i18n/errorcodes_en.json'),
  ...require('./i18n/requeststatus_en.json'),
}
const messagesPL = require('./i18n/pl')

@ghost ghost mentioned this pull request Jun 23, 2023
MartinKolbAtWork added a commit to MartinKolbAtWork/vite-plugins that referenced this pull request Jun 26, 2023
@MartinKolbAtWork
Copy link
Contributor Author

This broke our code (webpack originally, but also using vite):

const messagesDE = {
  ...require('./i18n/de'),
  ...require('./i18n/errorcodes_de.json'),
  ...require('./i18n/requeststatus_de.json'),
}
const messagesEN = {
  ...require('./i18n/en'),
  ...require('./i18n/errorcodes_en.json'),
  ...require('./i18n/requeststatus_en.json'),
}
const messagesPL = require('./i18n/pl')

Thanks for finding this, @JannikGM
I added a PR that will allow using the spread operator (...) preceeding the require statement:
#47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants