Skip to content
New issue

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

the option of vue-loader will be missing when use thread-loader #89

Open
smiledingvip opened this issue Apr 12, 2020 · 3 comments
Open

Comments

@smiledingvip
Copy link

when i use both of the vue-loader and thread-loader, for some reasons, the vue-loader is not directly in ./node_modules, so i have to manually set the one of the option values of the vue-loader which is called compile,like:
{ test: /\.vue$/, use: [ 'thread-loader', 'cache-loader', { loader: 'vue-loader', options: { compiler: require('./node_modules/@weiyi/hammer/vue-template-compiler') } } ] },
then there are some mistakes
Thread Loader (Worker 0) compiler.parseComponent is not a function at PoolWorker.fromErrorObj (D:\dingnan\vue-thread-loader\node_modules\thread-loader\dist\WorkerPool.js:262:12) at D:\dingnan\vue-thread-loader\node_modules\thread-loader\dist\WorkerPool.js:204:29 at mapSeries (D:\dingnan\vue-thread-loader\node_modules\neo-async\async.js:3625:14) at parse (D:\dingnan\vue-thread-loader\node_modules\@vue\component-compiler-utils\dist\parse.js:14:23) at Object.module.exports (D:\dingnan\vue-thread-loader\node_modules\vue-loader\lib\index.js:69:22) @ ./src/main.js 2:0-28 7:13-16
these mistakes above will not be appear when not using thread-loader,and i find the compile will be an empty object when using thread-loader, so i suppose it's a bug,i don't know how to do, can someone who can help me? thanks a lot! @ericclemmons @sapegin @MoOx

@MoOx
Copy link

MoOx commented Apr 12, 2020

Sorry I have no idea, I don't use any of this loader, nor webpack this days. Not sure why you poke me, but please try to not kind of randomly poke some open source maintainers.

@janvennemann
Copy link

janvennemann commented May 14, 2020

@smiledingvip you cannot use the compiler option when using thread-loader because its value is a function. Loader options need to be serialized so they can be passed into the workers, which will not work for functions. Also see #75

@MoOx i guess he pinged you because you are a member of webpack-contrib, which this repo belongs to.

@nyngwang
Copy link

@janvennemann Am I correct to say that each threads created by thread-loader will indeed all read and utilize the options passed into each loader, e.g. babel-loader, that comes after thread-loader in webpack.config.js? I also created an issue regarding this, could you take a look?

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

No branches or pull requests

4 participants