| 195 | |
| 196 | // dev only |
| 197 | function 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 | |
| 234 | function normalizeContainer( |
| 235 | container: Element | ShadowRoot | string, |