From b90c26fe908c126a03b286ed952b719a4624731b Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Thu, 13 Oct 2016 08:56:02 +0800 Subject: [PATCH] Config CDN for viz.js --- public/js/extra.js | 1 + public/views/foot.ejs | 2 +- public/views/pretty.ejs | 1 + public/views/slide.ejs | 1 + webpackBaseConfig.js | 4 ++++ 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/public/js/extra.js b/public/js/extra.js index af43c2b..1dd8676 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -306,6 +306,7 @@ function finishView(view) { } }); //graphviz + var Viz = require("viz.js"); var graphvizs = view.find(".graphviz.raw").removeClass("raw"); graphvizs.each(function (key, value) { try { diff --git a/public/views/foot.ejs b/public/views/foot.ejs index abf2da1..323d18f 100644 --- a/public/views/foot.ejs +++ b/public/views/foot.ejs @@ -20,7 +20,7 @@ <% } %> - + <%- include build/index-scripts %> diff --git a/public/views/pretty.ejs b/public/views/pretty.ejs index 7e617dc..ecce68d 100644 --- a/public/views/pretty.ejs +++ b/public/views/pretty.ejs @@ -102,6 +102,7 @@ <% } %> + <%- include build/pretty-scripts %> <%- include ga %> diff --git a/public/views/slide.ejs b/public/views/slide.ejs index ac34006..5b24ab4 100644 --- a/public/views/slide.ejs +++ b/public/views/slide.ejs @@ -102,6 +102,7 @@ <% } %> + <%- include build/slide-scripts %> diff --git a/webpackBaseConfig.js b/webpackBaseConfig.js index 22ddadd..33753ef 100644 --- a/webpackBaseConfig.js +++ b/webpackBaseConfig.js @@ -66,6 +66,10 @@ module.exports = { extensions: ["", ".js"] }, + externals: { + "viz.js": "Viz" + }, + module: { loaders: [{ test: /\.json$/,