Skip to content

Commit

Permalink
server esm 모듈 형식으로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
daengdaengLee committed Feb 23, 2021
1 parent a5865ec commit bb2a347
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dist"
],
"scripts": {
"test:server": "node ./test/server.cjs",
"test:server": "node test/server.js",
"test:client": "node bin/test.client.cjs",
"test:client:headless": "node bin/test.client.cjs --headless",
"build": "node ./bin/build.cjs"
Expand Down
19 changes: 13 additions & 6 deletions test/server.cjs → test/server.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
const path = require("path");
const express = require("express");
const webpack = require("webpack");
const middleware = require("webpack-dev-middleware");
const yargs = require("yargs");
import express from "express";
import path from "path";
import url from "url";
import webpack from "webpack";
import middleware from "webpack-dev-middleware";
import yargs from "yargs";
import { hideBin } from "yargs/helpers";

const argv = yargs.alias("p", "port").default("port", "8080").parse();
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));

const argv = yargs(hideBin(process.argv))
.alias("p", "port")
.default("port", "8080")
.parse();
const port = parseInt(argv.port, 10);

const app = express();
Expand Down

0 comments on commit bb2a347

Please sign in to comment.