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

Generated rollup\translations-loader-plugin.js not friendly to Windows developers #158

Open
mpowa705 opened this issue Sep 15, 2024 · 1 comment

Comments

@mpowa705
Copy link

mpowa705 commented Sep 15, 2024

The generated line in rollup\translations-loader-plugin.js

if (id.endsWith('.json') && id.includes(path.resolve(__dirname, '../src/translations'))) {

Does not work on Windows due to '/' in the id vs. the '\' in the __dirname on that system.

Changing this to:

id.endsWith('.json') && path.normalize(id).includes(path.resolve(__dirname, '..', 'src', 'translations'))

Resolves the issue on my Windows machine.

This should be changed in the webpack.config.js to ensure this works for future developers on Windows.

Will put up a PR shortly.

@mpowa705
Copy link
Author

mpowa705 commented Sep 15, 2024

Ah, just noticed lack of write permissions on myself.

Here's the change that'll fix this:

image

include: (id) => { const normalizedId = path.normalize(id) return normalizedId.includes(path.resolve(__dirname, '..', 'src', 'translations')) },

@mpowa705 mpowa705 changed the title Generated rollup\translations-loader-plugin.js not friendly to Windows Generated rollup\translations-loader-plugin.js not friendly to Windows developers Sep 15, 2024
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

No branches or pull requests

1 participant