Incompatible with thread-loader if compiler
or any option that includes non serializable value used.
#1705
Labels
compiler
or any option that includes non serializable value used.
#1705
Version
16.0.0-beta.4
Reproduction link
https://github.com/mmis1000/vue-3-bug-report-compiler-option
Steps to reproduce
npm build
What is expected?
It builds
What is actually happening?
It crashed with
The vue3 allow you to specify the compiler using the 'compiler' option of the loader.
However, when the https://cli.vuejs.org/config/#parallel is used(this is the default).
The config is send to other process as a string.
And any non-serializable options will break during the serialization.
The vue-loader should accept the
compiler
option withstring
type and require the package on its own like whatbabel
/eslint
did.They both accept package name/filename string instead of module instance.
So their options are completely fine with the serialization .
Something like
vue-loader/dist/templateLoader.js
const scopeId = query.scoped ? `data-v-${query.id}` : null; + if (typeof options.compiler === 'string') { + options.compiler = require(options.compiler) + } const compiled = compiler_sfc_1.compileTemplate({ source, inMap,
will do the job.
See also: vuejs/vue-cli#5723
The text was updated successfully, but these errors were encountered: