0.2.6 • Published 5 years ago

rundist v0.2.6

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

rundist

run your dist!

Install

npm install rundist

Usage

package.json add:

"scripts": {
    "dist": "rundist"
  }
npm run dist

Custom argv

"scripts": {
    "dist": "rundist --port 8080 --dirname dist --index index.html --extend script/app-watch-git.js"
  }

--port

default 3000

--index

default index.html

--dir / --dirname

default to path dist

--extend

script path to extend the server

default undefined

e.g: rundist --extend script/app-wathch-git.js

// script/app-watch-git.js
module.exports = function (app) {
  app.post('/', function () {
    // ...
  })
}

--https

default false

--sslkey / --sslcert

path of ssl key/cert file, should work with --https

e.g, rundist --port 443 --https --sslkey cert/localhost.key --sslcert cert/localhost.cert

compression

support

mime-type & expired

  'css': ['text/css', 'utf8', 'max-age=31536000'],
  'gif': ['image/gif', 'binary', 'max-age=86400'],
  'html': ['text/html', 'utf8', 'no-cache'],
  'ico': ['image/x-icon', 'binary', 'max-age=86400'],
  'jpeg': ['image/jpeg', 'binary', 'max-age=86400'],
  'jpg': ['image/jpeg', 'binary', 'max-age=86400'],
  'js': ['text/javascript', 'utf8', 'private, max-age=31536000'],
  'json': ['application/json', 'utf8', 'private, max-age=31536000'],
  'woff': ['application/x-font-woff', 'binary', 'private, max-age=31536000'],
  'woff2': ['application/x-font-woff', 'binary', 'private, max-age=31536000'],
  'eot': ['application/octet-stream', 'binary', 'private, max-age=31536000'],
  'otf': ['application/octet-stream', 'binary', 'private, max-age=31536000'],
  'ttf': ['application/octet-stream', 'binary', 'private, max-age=31536000'],
  'png': ['image/png', 'binary', 'max-age=86400'],
  'svg': ['image/svg+xml', 'binary', 'max-age=86400'],
  'tiff': ['image/tiff', 'binary', 'max-age=86400'],
  'txt': ['text/plain', 'utf8', 'max-age=86400'],
  'xml': ['text/xml', 'utf8', 'max-age=86400'],
  'flv': ['video/x-flv', 'binary', 'max-age=86400'],
  'mp4': ['video/mp4', 'binary', 'max-age=86400'],
  'm3u8': ['application/x-mpegURL', 'binary', 'max-age=86400'],
  'ts': ['video/MP2T', 'binary', 'max-age=86400'],
  '3gp': ['video/MP2T', 'binary', 'max-age=86400'],
  'mov': ['video/quicktime', 'binary', 'max-age=86400'],
  'wmv': ['video/x-ms-wmv', 'binary', 'max-age=86400']
0.2.6

5 years ago

0.2.5

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.5

5 years ago

0.1.3

5 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.7-ILoveNana

6 years ago

0.0.6-ILoveNana

6 years ago

0.0.5-ILoveNana

6 years ago

0.0.3-ILoveNana

6 years ago

0.0.2-ILoveNana

6 years ago

0.0.1-ILOVENANA

6 years ago

0.0.0-ILOVENANA

6 years ago

0.0.0-ILoveNANA

6 years ago

0.0.0-server

6 years ago

0.0.0-dist

6 years ago

0.0.0

6 years ago