Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

docs (typescript): add guide for webpack config TS#6105

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
deerawan wants to merge2 commits intowebpack:main
base:main
Choose a base branch
Loading
fromdeerawan:patch-1

Conversation

deerawan
Copy link

@deerawandeerawan commentedApr 25, 2022
edited
Loading

Add a guide on how to use webpack configuration in Typescriptwebpack.config.ts.

Fixes#6106

@linux-foundation-easycla
Copy link

linux-foundation-easyclabot commentedApr 25, 2022
edited
Loading

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: deerawan / name: Budi Irawan (1abf384)

@vercel
Copy link

vercelbot commentedApr 25, 2022
edited
Loading

The latest updates on your projects. Learn more aboutVercel for Git ↗︎

NameStatusPreviewUpdated
webpack-js-org✅ Ready (Inspect)Visit PreviewApr 25, 2022 at 3:59AM (UTC)

Regarding webpack configuration, instead of using Javascript for`webpack.config.js`, we could use the Typescript version`webpack.config.ts`. This is possible by installing some packages below.

```bash
npm install --save-dev ts-node @types/webpack

Choose a reason for hiding this comment

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

No need to install@types/webpack, webpack v5 has built-in types

snitin315 reacted with thumbs up emoji
Copy link
Author

Choose a reason for hiding this comment

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

That's right! I'll remove this part. I was putting it here because I ran this guide with webpack4, but I guess this always targets the latest version which is webpack5. 👍

Add a guide on how to use webpack configuration in Typescript  `webpack.config.ts`.Fixeswebpack#6106
@chenxsan
Copy link
Member

Actually we did have a guide herehttps://webpack.js.org/configuration/configuration-languages/#typescript, so maybe we can just add a link to that in this page?

@@ -94,6 +95,45 @@ module.exports = {

This will direct webpack to _enter_ through `./index.ts`, _load_ all `.ts` and `.tsx` files through the `ts-loader`, and _output_ a `bundle.js` file in our current directory.

Regarding webpack configuration, instead of using Javascript for `webpack.config.js`, we could use the Typescript version `webpack.config.ts`. This is possible by installing `ts-node`.

```bash
Copy link
Contributor

Choose a reason for hiding this comment

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

probably can have a link somewhere to link tohttps://webpack.js.org/configuration/configuration-languages/#typescript

which explains on using typescript for configuring webpack

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tanhauhautanhauhautanhauhau left review comments

@alexander-akaitalexander-akaitalexander-akait left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Doc: Add a section for webpack.config.ts
4 participants
@deerawan@chenxsan@tanhauhau@alexander-akait

[8]ページ先頭

©2009-2025 Movatter.jp