From a8c3b4126e6b62f423a71dba7ba55a85e7e2bde7 Mon Sep 17 00:00:00 2001 From: Justin Barry <328965+justinbarry@users.noreply.github.com> Date: Thu, 10 Jan 2019 14:20:03 -0800 Subject: Output Chrome 41 compatible version of 0x instant This is important for SEO as Googlebot is still using Chrome 41 to crawl thick clients. --- packages/instant/package.json | 8 ++++++++ packages/instant/webpack.config.js | 25 +++++++++++++++++++------ 2 files changed, 27 insertions(+), 6 deletions(-) (limited to 'packages') diff --git a/packages/instant/package.json b/packages/instant/package.json index 0888fc6a6..1104d9829 100644 --- a/packages/instant/package.json +++ b/packages/instant/package.json @@ -9,6 +9,7 @@ "main": "umd/instant.js", "scripts": { "build": "webpack --mode production", + "build:dev": "webpack --mode development", "build:ci": "yarn build", "dev": "dotenv webpack-dev-server -- --mode development", "lint": "tslint --format stylish --project .", @@ -50,6 +51,7 @@ "@0x/typescript-typings": "^3.0.6", "@0x/utils": "^2.1.1", "@0x/web3-wrapper": "^3.2.2", + "babel-runtime": "^6.26.0", "bowser": "^1.9.4", "copy-to-clipboard": "^3.0.8", "ethereum-types": "^1.1.4", @@ -78,6 +80,12 @@ "@types/redux": "^3.6.0", "@types/styled-components": "4.0.1", "awesome-typescript-loader": "^5.2.1", + "babel-loader": "^7.1.5", + "babel-preset-env": "^1.7.0", + "babel-plugin-transform-runtime": "^6.23.0", + "babel-plugin-transform-es3-member-expression-literals": "^6.22.0", + "babel-plugin-transform-es3-property-literals": "^6.22.0", + "babel-plugin-transform-object-assign": "^6.22.0", "dotenv-cli": "^1.4.0", "enzyme": "^3.6.0", "enzyme-adapter-react-16": "^1.5.0", diff --git a/packages/instant/webpack.config.js b/packages/instant/webpack.config.js index e74cf36d9..13d574de4 100644 --- a/packages/instant/webpack.config.js +++ b/packages/instant/webpack.config.js @@ -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); + }, }, ], }, -- cgit