Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@gyeongseokKang
Last active July 6, 2021 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gyeongseokKang/705482f331552a9a09c265e470e785c8 to your computer and use it in GitHub Desktop.
Save gyeongseokKang/705482f331552a9a09c265e470e785c8 to your computer and use it in GitHub Desktop.
webpack.config.js - 웹팩에 확장자 알려주기
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