Skip to content

Commit c5c5e6d

Browse files
committed
Tell webpack not to parse the highlight.js languages
Hopefully, this fixes element-hq#1046 without any side-effects. It relies on the fact that the languages files are pretty simple - in particular, they don't require any other modules. So we can tell webpack just to suck them in as they are, rather than parsing them and causing an explosm.
1 parent 2462ede commit c5c5e6d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎webpack.config.js‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ module.exports = {
1414
{ test: /\.js$/, loader: "babel", include: path.resolve('./src') },
1515
// css-raw-loader loads CSS but doesn't try to treat url()s as require()s
1616
{ test: /\.css$/, loader: ExtractTextPlugin.extract("css-raw-loader") },
17-
]
17+
],
18+
noParse: [
19+
// don't parse the languages within highlight.js. They cause stack
20+
// overflows (https://github.com/webpack/webpack/issues/1721), and
21+
// there is no need for webpack to parse them - they can just be
22+
// included as-is.
23+
/highlight\.js\/lib\/languages/,
24+
],
1825
},
1926
output: {
2027
devtoolModuleFilenameTemplate: function(info) {

0 commit comments

Comments
 (0)