Last active
July 6, 2021 08:15
-
-
Save gyeongseokKang/705482f331552a9a09c265e470e785c8 to your computer and use it in GitHub Desktop.
webpack.config.js - 웹팩에 확장자 알려주기
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require("path"); | |
module.exports = { | |
entry: "./src/index.tsx", | |
mode: "development", | |
output: { | |
filename: "bundle.js", | |
path: path.resolve(__dirname, "dist"), | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.css$/i, | |
use: ["style-loader", "css-loader"], | |
}, | |
{ | |
test: /\.(png|svg|jpg|jpeg|gif)$/i, | |
type: "asset/resource", | |
}, | |
{ | |
test: /\.(woff|woff2|eot|ttf|otf)$/i, | |
type: "asset/resource", | |
}, | |
{ | |
test: /\.(csv|tsv)$/i, | |
use: ["csv-loader"], | |
}, | |
{ | |
test: /\.(ts|tsx)$/i, | |
use: "babel-loader", | |
exclude: /node_modules/, | |
}, | |
], | |
}, | |
resolve: { | |
extensions: [".tsx", ".ts", ".js", ".jsx"], // <- 해당 부분이다. | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment