aboutsummaryrefslogtreecommitdiff
path: root/node_modules/express-minify/examples/preserve_comments.js
diff options
context:
space:
mode:
authorHumairAK <humair88@hotmail.com>2016-07-27 00:18:34 +0000
committerHumairAK <humair88@hotmail.com>2016-07-27 00:18:34 +0000
commit25706820837bd05cdc3b186eb1d5ebabf9688a61 (patch)
treeafbc83b902d3f0789d5174bd2e2798937ab57b26 /node_modules/express-minify/examples/preserve_comments.js
parent38594fd274a4bebee75ae71dbed457b39d253cae (diff)
parent714368c049f8749ed22c6d1d07bb3adc783dc349 (diff)
Merge branch 'master' of https://github.com/HumairAK/solutions_repo
Diffstat (limited to 'node_modules/express-minify/examples/preserve_comments.js')
-rw-r--r--node_modules/express-minify/examples/preserve_comments.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/node_modules/express-minify/examples/preserve_comments.js b/node_modules/express-minify/examples/preserve_comments.js
new file mode 100644
index 0000000..f812d54
--- /dev/null
+++ b/node_modules/express-minify/examples/preserve_comments.js
@@ -0,0 +1,18 @@
+var minify = require('express-minify');
+var express = require('express');
+var app = express();
+
+app.use(function(req, res, next)
+{
+ if (/\.(user|meta)\.js$/.test(req.url)) {
+ res._uglifyOutput = {
+ comments: true
+ };
+ }
+ next();
+});
+
+app.use(minify());
+app.use(express.static(__dirname + '/static'));
+
+app.listen(8080); \ No newline at end of file