diff options
author | Stan Hu <stanhu@gmail.com> | 2019-07-27 22:53:24 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-07-28 00:28:33 -0700 |
commit | cb3290a1a3deed5db6a5361ef3963a5eb83ef2aa (patch) | |
tree | 984cfd784f85c29a0b7c64a3e1049b3bdfa06430 /config/webpack.config.js | |
parent | 5861b9fd32435a0e691646e7ffef19dec2561ecf (diff) | |
download | gitlab-ce-cb3290a1a3deed5db6a5361ef3963a5eb83ef2aa.tar.gz |
Make pdf.js render CJK characterssh-add-cmaps-for-pdfjs
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
Diffstat (limited to 'config/webpack.config.js')
-rw-r--r-- | config/webpack.config.js | 8 |
1 files changed, 8 insertions, 0 deletions
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(), |