diff options
author | Justin Barry <328965+justinbarry@users.noreply.github.com> | 2019-01-11 06:20:03 +0800 |
---|---|---|
committer | Justin Barry <328965+justinbarry@users.noreply.github.com> | 2019-01-11 06:25:50 +0800 |
commit | a8c3b4126e6b62f423a71dba7ba55a85e7e2bde7 (patch) | |
tree | 0b9b4ec929db739782c3245f16cc92fd69d1f7d6 /packages | |
parent | a5b7a351609a5e6689bb97990216153f64302462 (diff) | |
download | dexon-0x-contracts-a8c3b4126e6b62f423a71dba7ba55a85e7e2bde7.tar.gz dexon-0x-contracts-a8c3b4126e6b62f423a71dba7ba55a85e7e2bde7.tar.zst dexon-0x-contracts-a8c3b4126e6b62f423a71dba7ba55a85e7e2bde7.zip |
Output Chrome 41 compatible version of 0x instant
This is important for SEO as Googlebot is still using Chrome 41 to crawl
thick clients.
Diffstat (limited to 'packages')
-rw-r--r-- | packages/instant/package.json | 8 | ||||
-rw-r--r-- | packages/instant/webpack.config.js | 25 |
2 files changed, 27 insertions, 6 deletions
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); + }, }, ], }, |