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

Add option to generate ES module file #191

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DuckThom
Copy link

@DuckThom DuckThom commented Feb 1, 2024

No description provided.

@@ -254,7 +254,7 @@ public function testShouldIgnoreDefaultOutputPathFromConfigIfTargetArgumentExist
* */
public function testShouldTemplateMessagesHasHandlebars()
{
$template = "$this->rootPath/src/Mariuzzo/LaravelJsLocalization/Generators/Templates/messages.js";
$template = "$this->rootPath/src/Mariuzzo/LaravelJsLocalization/Generators/Templates/messages.cjs";

Choose a reason for hiding this comment

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

There should be a separate test performed for the .mjs file, leaving the previous unchanged

Comment on lines +77 to +81
if ($options['module']) {
$template = $this->file->get(__DIR__.'/Templates/messages.mjs');
} else {
$template = $this->file->get(__DIR__.'/Templates/messages.cjs');
}

Choose a reason for hiding this comment

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

This is a breaking change as it changes the default file name extension from .js to .cjs

Choose a reason for hiding this comment

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

Please change the extension back to .js for when the option is not set to maintain compatibility. Otherwise this should be scheduled to major version

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