diff --git a/packages/namu/index.html b/packages/namu/index.html index 3464fe7..17bc2e8 100644 --- a/packages/namu/index.html +++ b/packages/namu/index.html @@ -1,19 +1,21 @@ + + + + + Document + + - - - - - Document - - - - -
-
- -
-
-
-
-
-
- - +
+ + +
- \ No newline at end of file +
+ + +
+ + +
+
+
+
+ + + + diff --git a/packages/namu/login.html b/packages/namu/login.html index e9e2398..dcb69cf 100644 --- a/packages/namu/login.html +++ b/packages/namu/login.html @@ -1,44 +1,56 @@ + + + + + Parang Cafe | Login + + + - - - - - Parang Cafe | Login - - - - - -
-
- -
`, +
+ ` ) - .join('')} + .join("")} `; @@ -97,14 +110,10 @@ $('nav').addEventListener('click', async event => { } }); -$('main').addEventListener('click', async event => { +$("main").addEventListener("click", async (event) => { if (!event.target.matches('label[for^="heart"]')) return; - const _id = localStorage.getItem('user_token'); - await addBookmark( - `http://localhost:3000/api/user/bookmark/${event.target.getAttribute( - 'key', - )}`, - { _id }, - ); - console.log('북마크에 저장되었습니다.'); + const _id = getLocal("user_token"); + await addBookmark(event.target.getAttribute("key"), _id); + + console.log("북마크에 저장되었습니다."); }); diff --git a/packages/namu/webpack.config.js b/packages/namu/webpack.config.js index 71bd288..007dedf 100644 --- a/packages/namu/webpack.config.js +++ b/packages/namu/webpack.config.js @@ -1,48 +1,48 @@ /* eslint-disable @typescript-eslint/no-var-requires */ -const path = require('path'); -const webpack = require('webpack'); -const HTMLWebpackPlugin = require('html-webpack-plugin'); -const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); +const path = require("path"); +const webpack = require("webpack"); +const HTMLWebpackPlugin = require("html-webpack-plugin"); +const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin"); module.exports = { - mode: 'development', + mode: "development", devServer: { port: 5510, hot: true, open: true, historyApiFallback: true, - watchFiles: ['src/**/*.ts', 'public/**/*'], + watchFiles: ["src/**/*.ts", "public/**/*"], }, // devtool: 'inline-source-map', - target: ['es5', 'web'], + target: ["es5", "web"], entry: { // 각 html에 필요한 entry 파일 - index: './src/main.js', - login: './src/login.js', + index: "./src/main.js", + login: "./src/login.js", }, output: { - path: path.resolve(__dirname, 'public'), - filename: '[chunkhash].js', + path: path.resolve(__dirname, "public"), + filename: "[chunkhash].js", clean: true, }, resolve: { - extensions: ['.ts', '.tsx', '.js', '.jsx'], + extensions: [".ts", ".tsx", ".js", ".jsx"], plugins: [new TsconfigPathsPlugin({})], }, plugins: [ new HTMLWebpackPlugin({ hash: true, - filename: 'index.html', - excludeChunks: ['login'], // entry에서 해당 리스트를 제외한 나머지 - template: path.resolve(__dirname, 'index.html'), - favicon: './favicon.ico', + filename: "index.html", + excludeChunks: ["login"], // entry에서 해당 리스트를 제외한 나머지 + template: path.resolve(__dirname, "index.html"), + favicon: "./favicon.ico", }), new HTMLWebpackPlugin({ hash: true, - filename: 'login.html', - chunks: ['login'], // entry에서 해당 리스트만 포함 - template: path.resolve(__dirname, 'login.html'), - favicon: './favicon.ico', + filename: "login.html", + chunks: ["login"], // entry에서 해당 리스트만 포함 + template: path.resolve(__dirname, "login.html"), + favicon: "./favicon.ico", }), new webpack.HotModuleReplacementPlugin(), ], @@ -65,16 +65,16 @@ module.exports = { // }, { test: /\.css$/, - use: ['style-loader', 'css-loader'], + use: ["style-loader", "css-loader"], }, { test: /\.(ts|tsx)$/, - include: path.join(__dirname, 'src'), + include: path.join(__dirname, "src"), exclude: /(node_modules)|(dist)/, use: { - loader: 'ts-loader', + loader: "ts-loader", options: { - configFile: path.resolve(__dirname, 'tsconfig.json'), + configFile: path.resolve(__dirname, "tsconfig.json"), // skip typechecking for speed transpileOnly: true, },