Skip to content

Commit

Permalink
Prevent Babel from running its regenerator transform, avoiding the kn…
Browse files Browse the repository at this point in the history
…own [regenerator unsafe-eval issue](facebook/regenerator#378). As far as I could tell our code is not relying on `yield` or generator functions (`function*`), so this should be safe. daily-js and the call machine successfully build. I validated that the change in this commit allowed me to remove the `globalThis.regeneratorRuntime = undefined` workaround from our Modern Wordfare demo.
  • Loading branch information
kompfner committed Jul 15, 2022
1 parent f666b03 commit 8a2d29e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion rollup.config.js
Expand Up @@ -22,7 +22,9 @@ export default [
babel({
exclude: 'node_modules/**',
babelHelpers: 'runtime',
presets: ['@babel/preset-env'],
presets: [
['@babel/preset-env', { exclude: ['transform-regenerator'] }],
],
plugins: [
'@babel/plugin-transform-runtime',
'@babel/plugin-proposal-class-properties',
Expand Down
4 changes: 3 additions & 1 deletion webpack.config.js
Expand Up @@ -40,7 +40,9 @@ const bundle = {
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
presets: [
['@babel/preset-env', { exclude: ['transform-regenerator'] }],
],
plugins: [
'@babel/plugin-transform-runtime',
'@babel/plugin-proposal-class-properties',
Expand Down

0 comments on commit 8a2d29e

Please sign in to comment.