From 08fb20a0dfa327d89cb9b1980312997f18eea242 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 22 Apr 2017 14:02:18 +0100 Subject: [PATCH] use a character class for brevity add a comment so this madness has meaning Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- webpack.config.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index f3912d1e3..efeab7fe8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -47,17 +47,18 @@ module.exports = { }, ], noParse: [ + // for cross platform compatibility use [\\\/] as the path separator + // this ensures that the regex trips on both Windows and *nix + // don't parse the languages within highlight.js. They cause stack // overflows (https://github.com/webpack/webpack/issues/1721), and // there is no need for webpack to parse them - they can just be // included as-is. - /highlight\.js\/lib\/languages/, - /highlight\.js\\lib\\languages/, + /highlight\.js[\\\/]lib[\\\/]languages/, // olm takes ages for webpack to process, and it's already heavily // optimised, so there is little to gain by us uglifying it. - /olm\/(javascript\/)?olm\.js$/, - /olm\\(javascript\\)?olm\.js$/, + /olm[\\\/](javascript[\\\/])?olm\.js$/, ], }, output: {