Skip to content
This repository has been archived by the owner on Sep 9, 2021. It is now read-only.

How to use it with Create React App #149

Closed
subhranshudas opened this issue May 23, 2018 · 5 comments
Closed

How to use it with Create React App #149

subhranshudas opened this issue May 23, 2018 · 5 comments

Comments

@subhranshudas
Copy link

Question - How to use worker loader with Create React App? Tried ejecting the CRA and putting webpack loader but i get something like -

./src/App.js
17:17-23 "export 'default' (imported as 'Worker') was not found in './worker.js'

version- "worker-loader": "^1.1.1"

@alexander-akait
Copy link
Member

@subhranshudas please create this question inside Create React App repo. Thanks!

@subhranshudas
Copy link
Author

@evilebottnawi thanks for the reply.

Have also created there one - facebook/create-react-app#4505

They have it in their backlog - facebook/create-react-app#3934
But thats for non-ejected setup which comes out of the box which is yet to be merged.

I am also trying for a ejected set up as well.
Typically worker-loader works for me in a normal webpack bundled project.

But want to know from worker-loader team, is there any standard procedure to integrate with CRA.

@alexander-akait
Copy link
Member

@subhranshudas no, we don't have standard procedure to integrate with CRA. A lot of boilerplates and CLIs build on webpack, we can't documented this in own README, it is should be done inside boilerplate docs.

@subhranshudas
Copy link
Author

@evilebottnawi thanks for the reply, btw if you would be interested to know, the following is what i tried with
facebook/create-react-app#4505 (comment)

@GaryBer
Copy link

GaryBer commented Oct 4, 2018

You have to use :

const myWorker = require('./myWorker.js'); // if using ts-loader, do not use ES6 imports

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants