Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
requirejs-middleware
Advanced tools
Middleware for Connect & Express that runs the RequireJS optimizer on demand. Production-ready and used by Mozilla Popcorn Maker.
npm install requirejs-middleware
var express = require("express"),
path = require("path"),
requirejsMiddleware = require("requirejs-middleware");
var app = express();
app.use(express.logger("dev"));
app.use(requirejsMiddleware({
src: path.join(__dirname + "/public"),
dest: path.join(__dirname + "/build"),
build: true,
debug: true,
modules: {
"/main.js": {
baseUrl: path.join(__dirname + "/public"),
include: "main"
}
}
}));
app.use(express.static(path.join(__dirname + "/build")));
app.use(express.static(path.join(__dirname + "/public")));
app.listen(3000);
See the full example in examples/almond/server.js.
src
- Source directory containing the RequireJS modules. Requireddest
- Destination directory to write built RequireJS modules to. Requiredbuild
- Optimize modules. When disabled, the module will be served up unchanged. Default falseonce
- Optimize modules once. Recommended for production deployments. Default falsedebug
- Output debugging information on the console. Default falsemodules
- Object containing module paths and RequireJS optimizer options. Required
baseUrl
- All modules are located relative to this path. Requiredinclude
- Include this module in the output file. Required if you are optimizing with almond.name
- Name of the module to optimize first. Defaults to almondFAQs
Connect middleware for RequireJS compiling
The npm package requirejs-middleware receives a total of 1 weekly downloads. As such, requirejs-middleware popularity was classified as not popular.
We found that requirejs-middleware demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.