Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-07-28 08:53:24 +0300
committerStan Hu <stanhu@gmail.com>2019-07-28 10:28:33 +0300
commitcb3290a1a3deed5db6a5361ef3963a5eb83ef2aa (patch)
tree984cfd784f85c29a0b7c64a3e1049b3bdfa06430 /config/webpack.config.js
parent5861b9fd32435a0e691646e7ffef19dec2561ecf (diff)
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
Diffstat (limited to 'config/webpack.config.js')
-rw-r--r--config/webpack.config.js8
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(),