We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reproduce:
npx create-react-app my-app --template typescript cd my-app npm start
Use react-app-rewired to customize Webpack
react-app-rewired
In config-overrides.js, add the comlink-loader at the top of rules
config-overrides.js
/** * Config to override webpack config from create-react-app */ const { override } = require('customize-cra'); module.exports = override((config, env) => { config.module.rules.unshift({ test: /\.worker.singleton\.(js|ts)$/i, loader: 'comlink-loader', options: { singleton: true } }); config.module.rules.unshift({ test: /\.worker\.(js|ts)$/i, loader: 'comlink-loader', options: { singleton: false } }); return config; });
task.worker.singleton.ts
export async function test(): string { return "something".replaceAll('s', 'g') }
Actual: In an old version browser (i.e. Android simulator), It will throw .replaceAll() is not a function
.replaceAll() is not a function
Expected: comlink-loader will bundle the polyfill to all .worker.ts to sync with the non-worker js file.
.worker.ts
Add the Polyfill manaully.
import 'core-js'; import 'regenerator-runtime/runtime'; export async function test(): string { return "something".replaceAll('s', 'g') }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Reproduce:
Use
react-app-rewired
to customize WebpackIn
config-overrides.js
, add the comlink-loader at the top of rulestask.worker.singleton.ts
Actual: In an old version browser (i.e. Android simulator), It will throw
.replaceAll() is not a function
Expected: comlink-loader will bundle the polyfill to all
.worker.ts
to sync with the non-worker js file.Solution
Add the Polyfill manaully.
The text was updated successfully, but these errors were encountered: