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

fixed babel configuration for #208 #240

Merged
merged 2 commits into from
Feb 12, 2023
Merged

fixed babel configuration for #208 #240

merged 2 commits into from
Feb 12, 2023

Conversation

vaukalak
Copy link
Contributor

@vaukalak vaukalak commented Jan 25, 2023

In specific scenarios, you would need to transpile some of node_modules. This addition allows to specify node_modules to include via webpacker.yml => additional_paths configuration.

closes #208

Copy link
Member

@justin808 justin808 left a comment

Choose a reason for hiding this comment

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

  1. Create a new setting, like packages_to_transpile
  2. Don't overload additional_paths
  3. Needs documentation and changelog

app_javascript,
createInMemoryFs,
createTestCompiler,
}
Copy link
Member

Choose a reason for hiding this comment

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

editor setup is incorrect

needs new line

Copy link
Contributor Author

@vaukalak vaukalak Jan 26, 2023

Choose a reason for hiding this comment

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

@justin808 thanks fixed and created a new issue for eslint config: #242

expect(tracked[ignored]).toBeUndefined();
});

test('process included node_modules', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

we should never transpile all of node_modules. Are you checking for only the additional paths?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@justin808 sure we do, and also we do have a test case for this. I'll work on a better verbiage.

const [tracked, loader] = createTrackLoader();
const compiler = createTestCompiler(createWebpackConfig(included, loader));
await compiler.run();
expect(tracked[included]).toBeTruthy();
Copy link
Member

Choose a reason for hiding this comment

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

Need to check that that the files outside of node_modules/included and inside of node_modules are not transpiled, in at least one test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

package/rules/esbuild.js Show resolved Hide resolved
@vaukalak vaukalak force-pushed the feature/SHP208 branch 2 times, most recently from 18f87a9 to b0da1e9 Compare January 30, 2023 15:38
@vaukalak
Copy link
Contributor Author

  1. Create a new setting, like packages_to_transpile
  2. Don't overload additional_paths
  3. Needs documentation and changelog

@justin808 I've updated the changelog, but I'm not sure how adding additional property packages_to_transpile would be helpful. The code of webpack rules wouldn't change from what we have in this PR. We do override additional_paths only during tests. The only real difference would be in the configuration:

additional_paths: ['app/assets', 'node_modules/to_transpile']

vs

additional_paths: ['app/assets']
packages_to_transpile: ['node_modules/to_transpile']

So packages_to_transpile would become the same thing as additional_paths, however with node_modules support. Those properties will be merged anyway when creating the configuration for webpack. So, I don't know how it can be helpful, IMHO it will only add more confusion.

@vaukalak vaukalak requested a review from justin808 January 30, 2023 15:49
@justin808
Copy link
Member

Let's update the branch and merge it.

@justin808 justin808 merged commit fd23b30 into master Feb 12, 2023
@justin808 justin808 deleted the feature/SHP208 branch February 12, 2023 00:40
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.

babel-loader rules ignores additional_paths that come from node_modules
2 participants