Output Chrome 41 compatible version of 0x instant

This is important for SEO as Googlebot is still using Chrome 41 to crawl
thick clients.
This commit is contained in:
Justin Barry
2019-01-10 14:20:03 -08:00
parent a5b7a35160
commit a8c3b4126e
3 changed files with 139 additions and 6 deletions

View File

@@ -141,12 +141,25 @@ const generateConfig = (dischargeTarget, heapConfigOptions, rollbarConfigOptions
},
{
test: /\.js$/,
loader: 'source-map-loader',
exclude: [
// instead of /\/node_modules\//
path.join(process.cwd(), 'node_modules'),
path.join(process.cwd(), '../..', 'node_modules'),
],
use: [{
loader: 'babel-loader',
options: {
"plugins": ["transform-runtime"],
'presets': [
['env', {
'targets': {
"chrome": 41
},
}],
],
},
}, {
loader: 'source-map-loader',
}],
exclude: function(modulePath) {
return /node_modules/.test(modulePath) &&
/node_modules\/(core-js|lodash|react|websocket)/.test(modulePath);
},
},
],
},