Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Hot module replacement on the server, in memory.

License

NotificationsYou must be signed in to change notification settings

rlindskog/solit

Repository files navigation

Simple HMR on the server, in memory.

Getting started

npm install --save solit

Then add this to your scripts

"scripts": {  "dev": "solit",  "build": "solit build",  "start": "solit start"}

Then add asrc/server/index.js directory

In that index.js file, add

import express from 'express'const app = express()app.get('/', (req, res) => {  res.json({ hello: 'world' })})export default app

And that is all!

Run in development

npm run dev

Build for production

npm run build

Run in production

npm run start

Alternatively, you can

npm install -g solit

and runsolit,solit build, orsolit start straight from the command line.

Configuration

Add asolit.config.js file in the directory of yourpackage.json file.

then add

module.exports = {  /* your sweet config */}

The default configuration is

module.exports =  {  this.rootDir = './',  this.srcDir = './src/server',  this.buildDir = 'dist/server',  this.filename = 'server.js', // output filename  this.host = '127.0.0.1',  this.port = 3000,  this.env = {} // just HOST and PORT.}

Big thanks tospawn-server-webpack-plugin,backpack, andnuxt for the inspiration and help.

About

Hot module replacement on the server, in memory.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp