From cb3290a1a3deed5db6a5361ef3963a5eb83ef2aa Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sat, 27 Jul 2019 22:53:24 -0700 Subject: Make pdf.js render CJK characters As mentioned in https://github.com/wojtekmaj/react-pdf/blob/master/README.md, pdf.js needs the bundled cMaps files to work. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/62152 --- config/webpack.config.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'config/webpack.config.js') diff --git a/config/webpack.config.js b/config/webpack.config.js index cd793743eb7..4b6a9e4b99e 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -6,6 +6,7 @@ const StatsWriterPlugin = require('webpack-stats-plugin').StatsWriterPlugin; const CompressionPlugin = require('compression-webpack-plugin'); const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; +const CopyWebpackPlugin = require('copy-webpack-plugin'); const ROOT_PATH = path.resolve(__dirname, '..'); const CACHE_PATH = process.env.WEBPACK_CACHE_PATH || path.join(ROOT_PATH, 'tmp/cache'); @@ -278,6 +279,13 @@ module.exports = { } }), + new CopyWebpackPlugin([ + { + from: path.join(ROOT_PATH, 'node_modules/pdfjs-dist/cmaps/'), + to: path.join(ROOT_PATH, 'public/assets/webpack/cmaps/'), + }, + ]), + // compression can require a lot of compute time and is disabled in CI IS_PRODUCTION && !NO_COMPRESSION && new CompressionPlugin(), -- cgit v1.2.1