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/23390990c79b4ac7e5902e8f5b08c1ef to your computer and use it in GitHub Desktop.
Save gyeongseokKang/23390990c79b4ac7e5902e8f5b08c1ef 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"],
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