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

(work-around) Exclude text file 'text!js-translation.json' from bundling #51

Merged
merged 5 commits into from
Mar 3, 2020

Conversation

tdgroot
Copy link
Member

@tdgroot tdgroot commented Mar 2, 2020

This fixes #47.

Now, I know that this is not the most thorough solution, but this gets my build going again. Feel free to give feedback/merge/decline!

@DrewML
Copy link
Contributor

DrewML commented Mar 3, 2020

Thanks @tdgroot! This looks great.

Would you be willing to add a test to cover this? We can add one in computerDepsForBundle.unit.js. I think the test would look roughly like this:

test('js-translation.json not included in computed dep list', () => {
    const graph = {
        a: ['b'],
        b: ['js-translation.json']
    };
    const entries = ['a'];
    expect(computeDepsForBundle(graph, entries)).toEqual(['a', 'b']);
});

@@ -0,0 +1,8 @@
/**
Copy link
Contributor

Choose a reason for hiding this comment

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

Thoughts on changing this file to something like knownIgnores or excludedFiles? We don't discriminate text vs other resource type in computeDepsForBundle, so we can probably just make use of this file for any future Magento-specific ignores we have.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, I renamed the file!

@tdgroot
Copy link
Member Author

tdgroot commented Mar 3, 2020

Thanks @tdgroot! This looks great.

Would you be willing to add a test to cover this?

Done!

@tdgroot
Copy link
Member Author

tdgroot commented Mar 3, 2020

Thank you for your review! 👍 I added the requested changes.

@DrewML DrewML changed the title Exclude text file 'text!js-translation.json' from being bundled (work-around) Exclude text file 'text!js-translation.json' from bundling Mar 3, 2020
@DrewML DrewML merged commit b05c0c3 into magento:master Mar 3, 2020
@DrewML
Copy link
Contributor

DrewML commented Mar 3, 2020

Thanks @tdgroot! Appreciate the contribution 😃

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.

Magento 2.3.4 JS-Translations fall back to default store language
2 participants