diff --git a/.gitignore b/.gitignore index e29169c..506e98f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ .netlify -build +dist node_modules \ No newline at end of file diff --git a/client/helpers/highlight.js b/client/helpers/highlight.js index 52d1620..d80bf36 100755 --- a/client/helpers/highlight.js +++ b/client/helpers/highlight.js @@ -1,4 +1,7 @@ -import hljs from 'highlight.js'; +import hljs from 'highlight.js/lib/highlight'; +import html from 'highlight.js/lib/languages/xml'; + +hljs.registerLanguage('html', html); const highlight = (input, language) => { const lang = language || 'html'; diff --git a/client/index.html b/client/index.html index cec3993..250c93b 100644 --- a/client/index.html +++ b/client/index.html @@ -7,7 +7,6 @@
- @@ -29,7 +42,38 @@ module.exports = { }, devtool: 'cheap-module-eavl-source-map', devServer: { - contentBase: path.join(__dirname, 'build'), + contentBase: path.join(__dirname, 'dist'), historyApiFallback: true, }, + plugins, + // See https://webpack.js.org/guides/caching/ + optimization: { + runtimeChunk: 'single', + moduleIds: 'hashed', + splitChunks: { + chunks: 'all', + maxInitialRequests: Infinity, + minSize: 0, + cacheGroups: { + vendor: { + // sync + async chunks + chunks: 'all', + name: 'vendors', + // import file path containing node_modules + test: /[\\/]node_modules[\\/]/, + priority: 20, + }, + /* + common: { + name: 'common', + minChunks: 2, + chunks: 'all', + priority: 10, + reuseExistingChunk: true, + enforce: true, + }, + */ + }, + }, + }, };