zendesk / app_scaffold

A scaffold for developers to build ZAF v2 apps
Apache License 2.0
92 stars 61 forks source link

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

Open mpowa705 opened 2 months ago

mpowa705 commented 2 months ago

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 commented 2 months ago

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')) },