提交 aeac06fa 编写于 作者: fxy060608's avatar fxy060608 提交者: 雪洛

fix: 1.0 增加 .uts 文件的条件编译过滤

上级 145646e0
export const PUBLIC_DIR = 'static'
export const EXTNAME_JS = ['.js', '.ts', '.jsx', '.tsx']
export const X_EXTNAME_JS = ['.uts', ...EXTNAME_JS]
export const EXTNAME_JS = ['.js', '.ts', '.jsx', '.tsx', '.uts']
export const EXTNAME_TS = ['.ts', '.tsx']
export const EXTNAME_VUE = ['.vue', '.nvue', '.uvue']
export const X_EXTNAME_VUE = ['.uvue', '.vue']
......
......@@ -12,7 +12,6 @@ import {
preNVueJs,
preNVueHtml,
X_EXTNAME_VUE,
X_EXTNAME_JS,
} from '@dcloudio/uni-cli-shared'
import { UniPluginFilterOptions } from '.'
......@@ -27,7 +26,7 @@ export function uniPrePlugin(
const isX = process.env.UNI_APP_X === 'true'
const PRE_JS_EXTNAME = ['.json', '.css']
.concat(isX ? X_EXTNAME_VUE : EXTNAME_VUE)
.concat(isX ? X_EXTNAME_JS : EXTNAME_JS)
.concat(EXTNAME_JS) // 因为 1.0 也会使用 uts uni_modules,所以 EXTNAME_JS 直接包含了 .uts 后缀
const PRE_HTML_EXTNAME = isX ? X_EXTNAME_VUE : EXTNAME_VUE
const filter = createFilter(options.include, options.exclude)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册