diff --git a/package.json b/package.json index 33b676dc..bf052a75 100644 --- a/package.json +++ b/package.json @@ -85,6 +85,7 @@ "request": "^2.75.0", "reveal.js": "^3.3.0", "sequelize": "^3.24.3", + "select2": "^3.5.2-browserify", "sequelize-cli": "^2.4.0", "shortid": "2.2.6", "socket.io": "~1.6.0", @@ -97,6 +98,7 @@ "to-markdown": "^3.0.1", "toobusy-js": "^0.5.1", "uws": "^0.11.0", + "velocity-animate": "^1.3.1", "visibilityjs": "^1.2.4", "viz.js": "^1.3.0", "winston": "^2.2.0", diff --git a/public/views/index.ejs b/public/views/index.ejs index f1b4e021..729987ca 100644 --- a/public/views/index.ejs +++ b/public/views/index.ejs @@ -13,25 +13,16 @@ HackMD - <%= __('Collaborative markdown notes') %> - - <% if(useCDN) { %> - + - - <% } else { %> - - - - - - - <% } %> - <%- include build/cover-header %> + <% } else { %> + <%- include build/cover-pack-header %> + <% } %> <%- include polyfill %> @@ -196,27 +187,18 @@ <%- include signin-modal %> - - <% if(useCDN) { %> + + + - <% } else { %> - - - - <% } %> - - - - - - - <%- include build/cover-scripts %> + <% } else { %> + <%- include build/cover-pack-scripts %> + <% } %> diff --git a/webpackBaseConfig.js b/webpackBaseConfig.js index 560635ca..38a630f0 100644 --- a/webpackBaseConfig.js +++ b/webpackBaseConfig.js @@ -34,19 +34,31 @@ module.exports = { filename: path.join(__dirname, 'public/views/build/index-scripts.ejs'), inject: false }), + new HtmlWebpackPlugin({ new HtmlWebpackPlugin({ template: 'public/views/includes/header.ejs', - chunks: ['vendor', 'cover'], + chunks: ['font', 'cover'], filename: path.join(__dirname, 'public/views/build/cover-header.ejs'), inject: false }), + new HtmlWebpackPlugin({ + template: 'public/views/includes/header.ejs', + chunks: ['font-pack', 'cover-styles-pack', 'cover'], + filename: path.join(__dirname, 'public/views/build/cover-pack-header.ejs'), + inject: false + }), new HtmlWebpackPlugin({ template: 'public/views/includes/scripts.ejs', - chunks: ['vendor', 'cover'], + chunks: ['cover'], filename: path.join(__dirname, 'public/views/build/cover-scripts.ejs'), inject: false }), new HtmlWebpackPlugin({ + template: 'public/views/includes/scripts.ejs', + chunks: ['common', 'cover-pack'], + filename: path.join(__dirname, 'public/views/build/cover-pack-scripts.ejs'), + inject: false + }), template: 'public/views/includes/header.ejs', chunks: ['vendor', 'pretty'], filename: path.join(__dirname, 'public/views/build/pretty-header.ejs'), @@ -73,13 +85,17 @@ module.exports = { ], entry: { - cover: path.join(__dirname, 'public/js/cover.js'), index: path.join(__dirname, 'public/js/index.js'), pretty: path.join(__dirname, 'public/js/pretty.js'), slide: path.join(__dirname, 'public/js/slide.js'), - vendor: [ + font: path.join(__dirname, 'public/css/google-font.css'), + "font-pack": path.join(__dirname, 'public/css/font.css'), + common: [ + "expose?jQuery!expose?$!jquery", + "velocity-animate", "imports?$=jquery!jquery-mousewheel", - "expose?filterXSS!xss", + "bootstrap" + ], "js-url", "expose?Spinner!spin.js", "script!Idle.Js", @@ -113,7 +129,8 @@ module.exports = { jqueryTextcomplete: path.join(__dirname, 'public/vendor/jquery-textcomplete/jquery.textcomplete.js'), codemirrorSpellChecker: path.join(__dirname, 'public/vendor/codemirror-spell-checker/spell-checker.min.js'), codemirrorInlineAttachment: path.join(__dirname, 'public/vendor/inlineAttachment/codemirror.inline-attachment.js'), - ot: path.join(__dirname, 'public/vendor/ot/ot.min.js') + ot: path.join(__dirname, 'public/vendor/ot/ot.min.js'), + listPagnation: path.join(__dirname, 'node_modules/list.pagination.js/dist/list.pagination.min.js'), } }, @@ -124,7 +141,8 @@ module.exports = { "jquery": "$", "moment": "moment", "handlebars": "Handlebars", - "highlight.js": "hljs" + "highlight.js": "hljs", + "select2": "select2" }, module: {