[Pkg-voip-commits] [janus] 140/163: Add support for building JavaScript modules from html/janus.js.
Jonas Smedegaard
dr at jones.dk
Sat Oct 28 01:22:24 UTC 2017
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag debian/0.2.5-1
in repository janus.
commit 5c9c4d1239bb8c684b8a47e018db4c60207b979c
Author: Johan Ouwerkerk <jm.ouwerkerk at gmail.com>
Date: Thu Oct 12 13:46:29 2017 +0200
Add support for building JavaScript modules from html/janus.js.
This commit paves the way for automatically generating JavaScript modules using rollup.js at build time (during make).
---
npm/.gitignore | 3 +++
npm/module.js | 8 ++++++++
npm/package.json | 14 ++++++++++++++
npm/rollup.config.js | 17 +++++++++++++++++
4 files changed, 42 insertions(+)
diff --git a/npm/.gitignore b/npm/.gitignore
new file mode 100644
index 0000000..18492aa
--- /dev/null
+++ b/npm/.gitignore
@@ -0,0 +1,3 @@
+bundles/
+node_modules/
+npm-debug.log
diff --git a/npm/module.js b/npm/module.js
new file mode 100644
index 0000000..07dc454
--- /dev/null
+++ b/npm/module.js
@@ -0,0 +1,8 @@
+/*
+ * Module shim for rollup.js to work with.
+ * Simply re-export Janus from janus.js, the real 'magic' is in the rollup config
+ */
+
+ at JANUS_CODE@
+
+export default Janus;
diff --git a/npm/package.json b/npm/package.json
new file mode 100644
index 0000000..cad55d9
--- /dev/null
+++ b/npm/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "janus",
+ "description": "The Janus WebRTC Server",
+ "author": "Meetecho",
+ "license": "GPL-3.0",
+ "repository": "github:meetecho/janus-gateway",
+ "scripts": {
+ "rollup": "rollup -c rollup.config.js"
+ },
+ "devDependencies": {
+ "rollup": "^0.50.0",
+ "rollup-plugin-replace": "^2.0.0"
+ }
+}
diff --git a/npm/rollup.config.js b/npm/rollup.config.js
new file mode 100644
index 0000000..5670728
--- /dev/null
+++ b/npm/rollup.config.js
@@ -0,0 +1,17 @@
+import replace from 'rollup-plugin-replace';
+import * as fs from 'fs';
+
+export default {
+ name: 'Janus',
+ input: 'module.js',
+ output: {
+ strict: false
+ },
+ plugins: [
+ replace({
+ JANUS_CODE: fs.readFileSync('../html/janus.js', 'utf-8'),
+ delimiters: ['@','@'],
+ includes: 'module.js'
+ })
+ ]
+};
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/janus.git
More information about the Pkg-voip-commits
mailing list