vue-loader
Advanced tools
Comparing version 16.8.0 to 16.8.1
@@ -0,1 +1,10 @@ | ||
## [16.8.1](https://github.com/vuejs/vue-loader/compare/v16.8.0...v16.8.1) (2021-09-22) | ||
### Bug Fixes | ||
* fix template options resolving for ts ([91f581b](https://github.com/vuejs/vue-loader/commit/91f581b99644119b68e586a0b642fff3811c8741)) | ||
# [16.8.0](https://github.com/vuejs/vue-loader/compare/v16.7.1...v16.8.0) (2021-09-22) | ||
@@ -15,2 +24,18 @@ | ||
# [16.8.0](https://github.com/vuejs/vue-loader/compare/v16.7.1...v16.8.0) (2021-09-22) | ||
### Bug Fixes | ||
* **hmr:** fix hmr regression ([bacc6a9](https://github.com/vuejs/vue-loader/commit/bacc6a9eeca40d6028a2d9a5f6ee02e6c8574abd)) | ||
### Features | ||
* enableTsInTemplate option ([7613534](https://github.com/vuejs/vue-loader/commit/7613534954b83489a060860b9525a0d121023c5b)) | ||
- When used with `ts-loader`, due to `ts-loader`'s cache invalidation behavior, it sometimes prevents the template from being hot-reloaded in isolation, causing the component to reload despite only the template being edited. If this is annoying, you can set this option to `false` (and avoid using TS expressions in templates). | ||
- Alternatively, leave this option on (by default) and use [`esbuild-loader`](https://github.com/privatenumber/esbuild-loader) to transpile TS instead, which doesn't suffer from this problem (it's also a lot faster). However, do note you will need to rely on TS type checking from other sources (e.g. IDE or `vue-tsc`). | ||
## [16.7.1](https://github.com/vuejs/vue-loader/compare/v16.7.0...v16.7.1) (2021-09-22) | ||
@@ -17,0 +42,0 @@ |
@@ -52,5 +52,3 @@ "use strict"; | ||
compiler: templateCompiler, | ||
compilerOptions: Object.assign(Object.assign({}, options.compilerOptions), (options.enableTsInTemplate | ||
? (0, util_1.resolveTemplateTSOptions)(descriptor, options.compilerOptions) | ||
: null)), | ||
compilerOptions: Object.assign(Object.assign({}, options.compilerOptions), (0, util_1.resolveTemplateTSOptions)(descriptor, options)), | ||
transformAssetUrls: options.transformAssetUrls || true, | ||
@@ -57,0 +55,0 @@ }, |
@@ -51,5 +51,3 @@ "use strict"; | ||
compiler: templateCompiler, | ||
compilerOptions: Object.assign(Object.assign(Object.assign({}, options.compilerOptions), { scopeId: query.scoped ? `data-v-${scopeId}` : undefined, bindingMetadata: script ? script.bindings : undefined }), (options.enableTsInTemplate | ||
? (0, util_1.resolveTemplateTSOptions)(descriptor, options.compilerOptions) | ||
: null)), | ||
compilerOptions: Object.assign(Object.assign(Object.assign({}, options.compilerOptions), { scopeId: query.scoped ? `data-v-${scopeId}` : undefined, bindingMetadata: script ? script.bindings : undefined }), (0, util_1.resolveTemplateTSOptions)(descriptor, options)), | ||
transformAssetUrls: options.transformAssetUrls || true, | ||
@@ -56,0 +54,0 @@ }); |
import { SFCDescriptor, CompilerOptions } from '@vue/compiler-sfc'; | ||
export declare function resolveTemplateTSOptions(descriptor: SFCDescriptor, options: CompilerOptions | null | undefined): CompilerOptions; | ||
import { VueLoaderOptions } from '.'; | ||
export declare function resolveTemplateTSOptions(descriptor: SFCDescriptor, options: VueLoaderOptions): CompilerOptions | null; |
@@ -5,6 +5,8 @@ "use strict"; | ||
function resolveTemplateTSOptions(descriptor, options) { | ||
var _a, _b; | ||
var _a, _b, _c; | ||
if (options.enableTsInTemplate === false) | ||
return null; | ||
const lang = ((_a = descriptor.script) === null || _a === void 0 ? void 0 : _a.lang) || ((_b = descriptor.scriptSetup) === null || _b === void 0 ? void 0 : _b.lang); | ||
const isTS = !!(lang && /tsx?$/.test(lang)); | ||
let expressionPlugins = (options && options.expressionPlugins) || []; | ||
let expressionPlugins = ((_c = options === null || options === void 0 ? void 0 : options.compilerOptions) === null || _c === void 0 ? void 0 : _c.expressionPlugins) || []; | ||
if (isTS && !expressionPlugins.includes('typescript')) { | ||
@@ -11,0 +13,0 @@ expressionPlugins = [...expressionPlugins, 'typescript']; |
{ | ||
"name": "vue-loader", | ||
"version": "16.8.0", | ||
"version": "16.8.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "author": "Evan You", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
76503
1169