Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions packages/react/rollup/static-copy-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export default function StaticCopy({ targets }) {
const rootPath = config.build.outDir
await Promise.all(
targets.map(async ({ src, dest, modifier = (data) => data }) => {
// This is to compensate for windows file paths and how glob works
src = src.replaceAll("\\", "/")
const paths = await glob(src)
const destinationPath = path.resolve(rootPath, dest)
await processFiles(paths, destinationPath, modifier)
Expand Down
3 changes: 2 additions & 1 deletion packages/react/rollup/translations-loader-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export default function TranslationsLoader() {
return {
name: 'translations-loader',
transform: async (_, id) => {
if (id.endsWith('.json') && id.includes(path.resolve(__dirname, '../src/translations'))) {
// The replaceAll is to compensate for windows file paths having backslashes instead of forward slashes
if (id.endsWith('.json') && id.includes(path.resolve(__dirname, '../src/translations').replaceAll("\\", "/"))) {
const contentFile = await fs.readFile(id)

const translations = JSON.parse(contentFile)
Expand Down