From 9443a6f996beba74412f2b69fe42d86ea5fc1e51 Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Fri, 14 Oct 2016 09:21:25 +0800 Subject: [PATCH 1/4] Sync webpack config changes to production --- webpack.production.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/webpack.production.js b/webpack.production.js index 1c2190ab..95b90b97 100644 --- a/webpack.production.js +++ b/webpack.production.js @@ -7,11 +7,15 @@ var HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = Object.assign({}, baseConfig, { plugins: [ new webpack.ProvidePlugin({ - '_': 'lodash', Visibility: "visibilityjs", Cookies: "js-cookie", emojify: "emojify.js", - key: "keymaster" + key: "keymaster", + $: "jquery", + jQuery: "jquery", + "window.jQuery": "jquery", + "moment": "moment", + "Handlebars": "handlebars" }), new ExtractTextPlugin("[name].css"), new webpack.optimize.CommonsChunkPlugin({ From 142b4c6771f99daef4ea5063a30b36e2b510c8ac Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Fri, 14 Oct 2016 09:21:41 +0800 Subject: [PATCH 2/4] Move highlight.js to CDN --- package.json | 1 - public/views/foot.ejs | 1 + public/views/index.ejs | 1 + public/views/pretty.ejs | 1 + public/views/slide.ejs | 1 + webpackBaseConfig.js | 3 ++- 6 files changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6b313bef..1e693483 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "gist-embed": "github:yukaii/gist-embed", "handlebars": "^4.0.5", "helmet": "^2.3.0", - "highlight.js": "^9.7.0", "i18n": "^0.8.3", "imgur": "git+https://github.com/hackmdio/node-imgur.git", "jquery": "^3.1.1", diff --git a/public/views/foot.ejs b/public/views/foot.ejs index 4294070e..f1bc0c5d 100644 --- a/public/views/foot.ejs +++ b/public/views/foot.ejs @@ -23,6 +23,7 @@ + <%- include build/index-scripts %> diff --git a/public/views/index.ejs b/public/views/index.ejs index 4ab3cdec..bdfe0580 100644 --- a/public/views/index.ejs +++ b/public/views/index.ejs @@ -208,6 +208,7 @@ + <%- include build/cover-scripts %> diff --git a/public/views/pretty.ejs b/public/views/pretty.ejs index 8fecb04c..8968fec3 100644 --- a/public/views/pretty.ejs +++ b/public/views/pretty.ejs @@ -103,6 +103,7 @@ + <%- include build/pretty-scripts %> diff --git a/public/views/slide.ejs b/public/views/slide.ejs index 398f40b4..089ced37 100644 --- a/public/views/slide.ejs +++ b/public/views/slide.ejs @@ -104,6 +104,7 @@ + <%- include build/slide-scripts %> diff --git a/webpackBaseConfig.js b/webpackBaseConfig.js index 7648cd8f..946ef4db 100644 --- a/webpackBaseConfig.js +++ b/webpackBaseConfig.js @@ -129,7 +129,8 @@ module.exports = { "lodash": "_", "jquery": "$", "moment": "moment", - "handlebars": "Handlebars" + "handlebars": "Handlebars", + "highlight.js": "hljs" }, module: { From 3d1bc8a8cbd49a35e3e3bdb1d5e3f4f0eeb4e171 Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Fri, 14 Oct 2016 09:25:45 +0800 Subject: [PATCH 3/4] Move list-pagination plugin to CDN --- public/views/index.ejs | 1 + webpackBaseConfig.js | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/public/views/index.ejs b/public/views/index.ejs index bdfe0580..c486f05d 100644 --- a/public/views/index.ejs +++ b/public/views/index.ejs @@ -208,6 +208,7 @@ + <%- include build/cover-scripts %> diff --git a/webpackBaseConfig.js b/webpackBaseConfig.js index 946ef4db..65afb48b 100644 --- a/webpackBaseConfig.js +++ b/webpackBaseConfig.js @@ -87,7 +87,6 @@ module.exports = { "expose?Spinner!spin.js", "script!Idle.Js", "expose?LZString!lz-string", - "expose?ListPagination!list.pagination.js/dist/list.pagination.js", "script!codemirror", "script!select2", "script!inlineAttachment", From 4c1109b70bd31090e410850dee0a39e6edf1a19a Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Fri, 14 Oct 2016 09:56:19 +0800 Subject: [PATCH 4/4] Move gist-embed to CDN --- package.json | 1 - public/js/public.js | 2 -- public/views/foot.ejs | 1 + public/views/pretty.ejs | 1 + public/views/slide.ejs | 1 + webpackBaseConfig.js | 7 +------ 6 files changed, 4 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 1e693483..80a0e22b 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,6 @@ "file-saver": "^1.3.3", "flowchart.js": "^1.6.3", "formidable": "^1.0.17", - "gist-embed": "github:yukaii/gist-embed", "handlebars": "^4.0.5", "helmet": "^2.3.0", "i18n": "^0.8.3", diff --git a/public/js/public.js b/public/js/public.js index af8c0924..f83ef41f 100644 --- a/public/js/public.js +++ b/public/js/public.js @@ -5,9 +5,7 @@ require('prismjs/themes/prism.css'); require('highlight.js/styles/github-gist.css'); /* other vendors plugin */ -require('gist-embed'); require('string'); -require('highlight.js'); require('prismjs'); require('prismjs/components/prism-wiki'); require('to-markdown'); diff --git a/public/views/foot.ejs b/public/views/foot.ejs index f1bc0c5d..e2af5b0e 100644 --- a/public/views/foot.ejs +++ b/public/views/foot.ejs @@ -24,6 +24,7 @@ + <%- include build/index-scripts %> diff --git a/public/views/pretty.ejs b/public/views/pretty.ejs index 8968fec3..4f6e7a4d 100644 --- a/public/views/pretty.ejs +++ b/public/views/pretty.ejs @@ -103,6 +103,7 @@ + diff --git a/public/views/slide.ejs b/public/views/slide.ejs index 089ced37..f7e17eea 100644 --- a/public/views/slide.ejs +++ b/public/views/slide.ejs @@ -105,6 +105,7 @@ + <%- include build/slide-scripts %> diff --git a/webpackBaseConfig.js b/webpackBaseConfig.js index 65afb48b..a39f8384 100644 --- a/webpackBaseConfig.js +++ b/webpackBaseConfig.js @@ -81,7 +81,6 @@ module.exports = { locale: path.join(__dirname, 'public/js/locale.js'), vendor: [ "imports?$=jquery!jquery-mousewheel", - "script!gist-embed", "expose?filterXSS!xss", "js-url", "expose?Spinner!spin.js", @@ -160,11 +159,7 @@ module.exports = { }, { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml" - }], - - noParse: [ - "gist-embed" - ] + }] }, node: {