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

Fix writing a loder instructions #3723

Merged
merged 2 commits into from
Sep 29, 2020

Conversation

danielhusar
Copy link
Contributor

When I followed the tutorial for writing loader, I have noticed couple of issues, see the inline comments.

@vercel
Copy link

vercel bot commented May 1, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/webpack-docs/webpack-js-org/h7v6nlfp0
✅ Preview: https://webpack-js-org-git-fork-danielhusar-writing-a-loader.webpack-docs.vercel.app

}
}]
}
});

compiler.outputFileSystem = createFsFromVolume(new Volume());
const volume = createFsFromVolume(new Volume());
volume.join = path.join;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without this, it throws error: TypeError: this.outputFileSystem.join is not a function

@@ -377,6 +377,9 @@ __package.json__
{
"scripts": {
"test": "jest"
},
"jest": {
"testEnvironment": "node"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

options: {
name: 'Alice'
}
options,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's bit nicer to pass options from your tests so this is more reusable.

@chenxsan
Copy link
Member

Oh, I didn't notice there's already a similar pull request here before I submit #3739. I should search the pull request first next time.

@EugeneHlushko
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants