MCPcopy
hub / github.com/vuejs/core / injectCompilerOptionsCheck

Function injectCompilerOptionsCheck

packages/runtime-dom/src/index.ts:197–232  ·  view source on GitHub ↗
(app: App)

Source from the content-addressed store, hash-verified

195
196// dev only
197function injectCompilerOptionsCheck(app: App) {
198 if (isRuntimeOnly()) {
199 const isCustomElement = app.config.isCustomElement
200 Object.defineProperty(app.config, 'isCustomElement', {
201 get() {
202 return isCustomElement
203 },
204 set() {
205 warn(
206 `The \`isCustomElement\` config option is deprecated. Use ` +
207 `\`compilerOptions.isCustomElement\` instead.`,
208 )
209 },
210 })
211
212 const compilerOptions = app.config.compilerOptions
213 const msg =
214 `The \`compilerOptions\` config option is only respected when using ` +
215 `a build of Vue.js that includes the runtime compiler (aka "full build"). ` +
216 `Since you are using the runtime-only build, \`compilerOptions\` ` +
217 `must be passed to \`@vue/compiler-dom\` in the build setup instead.\n` +
218 `- For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.\n` +
219 `- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader\n` +
220 `- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`
221
222 Object.defineProperty(app.config, 'compilerOptions', {
223 get() {
224 warn(msg)
225 return compilerOptions
226 },
227 set() {
228 warn(msg)
229 },
230 })
231 }
232}
233
234function normalizeContainer(
235 container: Element | ShadowRoot | string,

Callers 1

index.tsFile · 0.85

Calls 1

isRuntimeOnlyFunction · 0.90

Tested by

no test coverage detected