Last active
July 6, 2021 08:15
-
-
Save gyeongseokKang/23390990c79b4ac7e5902e8f5b08c1ef 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"], | |
alias: { // | |
root: __dirname, // <- 요 부분이 root, | |
src: path.resolve(__dirname, "src"), // 경로의 시작점을 알려주는 코드이다. | |
}, | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment