express-add-manifest
v1.0.2
Published
add manifest file message to express app
Downloads
2
Maintainers
Readme
express-manifest
在生产环境中,将webpack打包生成的manifest.json中的map信息挂载到express的实例下面的常量中。
Getting Started
To begin, you'll need to install express-manifest
:
npm install express-add-manifest
or, first, you need to add dependencies
like this:
{
"dependencies": {
"express-add-manifest": "^1.0.1-rc01"
}
}
second, use npm install all packages
$ npm install
Then add the loader to your express
config. For example:
server.js
const express = require("express");
const expressManifest = require('@noxfed/express-manifest');
const app = express();
expressManifest({
express: app,
mount: 'locals.manifest',
path: 'source'
})
Options
所有属性均为必填项
| Name | Type | Default | Description |
| :-------: | :------: | :---------------: | :----------------- |
| express
| Function
| null
| express实例 |
| mount
| String
| locals.manifest
| 挂载位置 |
| path
| String
| null
| 需要挂载的文件路径 |