https://github.com/jaylanchen/express-handlebars-memory-fs
Enable Express-handlebars to support read handlebars files from memory.
https://github.com/jaylanchen/express-handlebars-memory-fs
express express-handlebars memory-fs webpack webpack-dev-middleware
Last synced: 3 months ago
JSON representation
Enable Express-handlebars to support read handlebars files from memory.
- Host: GitHub
- URL: https://github.com/jaylanchen/express-handlebars-memory-fs
- Owner: JaylanChen
- License: mpl-2.0
- Created: 2019-04-15T05:30:00.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T17:12:25.000Z (over 3 years ago)
- Last Synced: 2025-07-05T09:19:11.241Z (9 months ago)
- Topics: express, express-handlebars, memory-fs, webpack, webpack-dev-middleware
- Language: JavaScript
- Homepage:
- Size: 304 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Enhances [express-handlebars](https://github.com/ericf/express-handlebars) to support read hanblebars files from memory
========================================
P.S:webpack 4.x please use version 1.x
Installation
------------
You must be running express, express-handlebars, webpack, webpack-dev-middleware on node.
Install the plugin with npm:
```shell
$ npm install --save-dev express-handlebars-memory-fs
```
Usage
-----------
Use the plugin in your node server.js:
```javascript
const express = require('express');
const webpackDevMiddleware = require("webpack-dev-middleware");
const expressHandlebarsMemoryFs = require('express-handlebars-memory-fs');
const app = express();
// express-handlebars and other code
let webpackConfig = require("./build");
let compiler = webpack(webpackConfig);
app.use(webpackDevMiddleware(compiler, {
// webpack-dev-middleware options
})
);
expressHandlebarsMemoryFs(compiler.outputFileSystem);
```
This plugin does not do anything in the following cases.
1、It will do anything if in a production environment(process.env.NODE_ENV === 'production')