File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
docs/4-advanced/02-bundler Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 33 "private" : true ,
44 "version" : " 0.0.0" ,
55 "scripts" : {
6- "start" : " node server/main.js " ,
6+ "start" : " node server/main.mjs " ,
77 "build" : " vite build client --outDir ../dist" ,
88 "prestart" : " npm run build"
99 },
Original file line number Diff line number Diff line change 1- const express = require ( "express" ) ;
1+ import express from "express" ;
22const app = express ( ) ;
33
44app . use ( express . json ( ) ) ;
Original file line number Diff line number Diff line change 141141├── package.json
142142├── package-lock.json
143143└── server
144- └── main.js
144+ └── main.mjs
145145```
146146
147147<ViewSource url = { import .meta .url } path = " _samples/fullstack-app" />
@@ -151,16 +151,16 @@ app
151151``` json title="/package.json"
152152{
153153 "scripts" : {
154- "start" : " node server/main.js " ,
154+ "start" : " node server/main.mjs " ,
155155 "build" : " vite build client --outDir ../dist"
156156 }
157157}
158158```
159159
160160` express.static ` により Vite が作成したディレクトリを指定すれば完成です。
161161
162- ``` javascript title="server/main.js "
163- const express = require ( " express" ) ;
162+ ``` javascript title="server/main.mjs "
163+ import express from " express" ;
164164const app = express ();
165165
166166app .use (express .json ());
You can’t perform that action at this time.
0 commit comments