Conversation
| callback | ||
| }); | ||
| } | ||
| // else if ( |
There was a problem hiding this comment.
Is there a reason we commented this out instead of erasing it? Usually commenting out chunks is a bit of a code smell
There was a problem hiding this comment.
I left it commented out because the upstream CMP has a "todo" to remove this, since i've already removed it i want the comment here so it matches up with the upstream file and context is given
| @@ -0,0 +1 @@ | |||
| 8.11.3 | |||
| // import CopyWebpackPlugin from 'copy-webpack-plugin'; | ||
| import autoprefixer from 'autoprefixer'; | ||
| import path from 'path'; | ||
| // import UglifyJS from 'uglify-es'; |
| "clean": "rm -rf build", | ||
| "dev": "cross-env NODE_ENV=development webpack-dev-server --inline --hot --progress", | ||
| "start": "serve build -s -c 1", | ||
| "clean": "rm -rf dist", |
There was a problem hiding this comment.
yarn add -D rimraf and replace this with:
"clean": "rimraf dist",
This allows the command to work cross platform (mac/linux/bsd/windows)
There was a problem hiding this comment.
Actually we already have rimraf so you don't even need to add it
| @@ -0,0 +1,135 @@ | |||
| // __cmp('setConsentUiCallback', callback) QUANTCAST | |||
| import 'core-js/fn/array/find-index'; | |||
There was a problem hiding this comment.
Using this library in one of our sites will double up the bundle size for anything we're using babel-polyfill for. I think what we want to do is something like this:
https://stackoverflow.com/questions/33380063/what-is-the-best-way-to-include-babel-polyfill-using-multiple-entry-points
In development mode in webpack we'd include the polyfill but in production mode we wouldn't include it
There was a problem hiding this comment.
Another reference is here:
https://babeljs.io/docs/en/babel-polyfill.html#usage-in-node-browserify-webpack
There was a problem hiding this comment.
Im not using babel-polyfill because it added another 130k to the package. But, would be nice to use it, ill make a ticket (see test plan)
| @@ -0,0 +1,73 @@ | |||
| /* eslint-disable max-nested-callbacks */ | |||
There was a problem hiding this comment.
^ Whenever I see this I know a party's coming soon
| 'process.env.NODE_ENV': JSON.stringify(ENV) | ||
| }), | ||
| new webpack.ProvidePlugin({ | ||
| Promise: 'promise-polyfill' |
There was a problem hiding this comment.
The babel-polyfill tweak should allow you to remove this
There was a problem hiding this comment.
(see test plan) i removed babel-polyfill because it bloats the library (by 130k), will make a ticket to figure out how separate out the polyfills or optimize this
|
|
||
| // Expose `processCommand` as the CMP implementation | ||
| window[CMP_GLOBAL_NAME] = cmp.processCommand; | ||
| // window[CMP_GLOBAL_NAME] = cmp.processCommand; |
There was a problem hiding this comment.
same, leaving this comment in because i want to call this out when doing another upstream merge.
Background
This is work in progress
Replace core-js with babel plugin for IE11 polyfill supportsee useBuiltIns: figure out how to remove polyfills that aren't actually used in the codebase babel/babel-preset-env#84 Adds too much bloat, would like to add packageSize module firstTest Plan