Toggle navigation
Toggle navigation
This project
Loading...
Sign in
강연욱
/
myYoutube
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
2
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Flare-k
2020-06-09 18:42:31 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8bb0eeeca52db3b7395d85502af8df371c1ef5e7
8bb0eeec
1 parent
5fe0152d
check babel
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
5 deletions
.gitignore
app.js
assets/js/main.js
package.json
static/main.js
views/layouts/main.pug
webpack.config.js
.gitignore
View file @
8bb0eee
...
...
@@ -116,4 +116,5 @@ dist
.pnp.*
package-lock.json
uploads
\ No newline at end of file
uploads
static
\ No newline at end of file
...
...
app.js
View file @
8bb0eee
...
...
@@ -14,9 +14,10 @@ const app = express();
app
.
use
(
helmet
());
app
.
set
(
"view engine"
,
"pug"
);
app
.
use
(
"/uploads"
,
express
.
static
(
"uploads"
));
app
.
use
(
"/static"
,
express
.
static
(
"static"
));
app
.
use
(
cookieParser
());
app
.
use
(
bodyParser
.
json
());
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
true
}));
//json, html, text, urlencoded 할 거 없이 다 parser할 수 있도록 설정해줘야 한다.
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
true
}));
//
json, html, text, urlencoded 할 거 없이 다 parser할 수 있도록 설정해줘야 한다.
app
.
use
(
morgan
(
"dev"
));
app
.
use
(
localsMiddleware
);
...
...
@@ -24,4 +25,4 @@ app.use(routes.home, globalRouter);
app
.
use
(
routes
.
users
,
userRouter
);
app
.
use
(
routes
.
videos
,
videoRouter
);
export
default
app
;
//파일을 불러올때 app object를 준다는 의미.
\ No newline at end of file
export
default
app
;
// 파일을 불러올때 app object를 준다는 의미.
...
...
assets/js/main.js
View file @
8bb0eee
import
"../scss/style.scss"
;
const
something
=
async
()
=>
{
console
.
log
(
"something"
);
};
...
...
package.json
View file @
8bb0eee
...
...
@@ -5,7 +5,7 @@
"main"
:
"app.js"
,
"scripts"
:
{
"dev:server"
:
"nodemon --exec babel-node init.js --delay 2"
,
"dev:assets"
:
"WEBPACK_ENV=development webpack"
,
"dev:assets"
:
"WEBPACK_ENV=development webpack
-w
"
,
"build:assets"
:
"WEBPACK_ENV=production webpack"
},
"repository"
:
{
...
...
@@ -17,8 +17,10 @@
"dependencies"
:
{
"@babel/core"
:
"^7.9.6"
,
"@babel/node"
:
"^7.8.7"
,
"@babel/polyfill"
:
"^7.10.1"
,
"@babel/preset-env"
:
"^7.9.6"
,
"autoprefixer"
:
"^9.8.0"
,
"babel-loader"
:
"^8.1.0"
,
"body-parser"
:
"^1.19.0"
,
"cookie-parser"
:
"^1.4.5"
,
"css-loader"
:
"^3.5.3"
,
...
...
static/main.js
View file @
8bb0eee
This diff could not be displayed because it is too large.
views/layouts/main.pug
View file @
8bb0eee
...
...
@@ -5,8 +5,10 @@ html
head
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
title #{pageTitle} | #{siteName}
link(rel="stylesheet", href="/static/style.css")
body
include ../partials/header
main
block content
include ../partials/footer
script(src="/static/main.js")
...
...
webpack.config.js
View file @
8bb0eee
...
...
@@ -7,7 +7,7 @@ const ENTRY_FILE = path.resolve(__dirname, "assets", "js", "main.js");
const
OUTPUT_DIR
=
path
.
join
(
__dirname
,
"static"
);
const
config
=
{
entry
:
[
ENTRY_FILE
],
entry
:
[
"@babel/polyfill"
,
ENTRY_FILE
],
mode
:
MODE
,
module
:
{
rules
:
[
...
...
Please
register
or
login
to post a comment