wip: default mode for compat build
This commit is contained in:
parent
c5c304af14
commit
810fe4d583
@ -456,7 +456,9 @@ export type CompatConfig = Partial<
|
|||||||
MODE?: 2 | 3
|
MODE?: 2 | 3
|
||||||
}
|
}
|
||||||
|
|
||||||
export const globalCompatConfig: CompatConfig = {}
|
export const globalCompatConfig: CompatConfig = {
|
||||||
|
MODE: 2
|
||||||
|
}
|
||||||
|
|
||||||
export function configureCompat(config: CompatConfig) {
|
export function configureCompat(config: CompatConfig) {
|
||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
|
@ -55,22 +55,17 @@ function compileToFunction(
|
|||||||
extend(
|
extend(
|
||||||
{
|
{
|
||||||
hoistStatic: true,
|
hoistStatic: true,
|
||||||
onError(err) {
|
onError: __DEV__ ? onError : undefined,
|
||||||
if (__DEV__) {
|
onWarn: __DEV__ ? e => onError(e, true) : NOOP
|
||||||
onError(err)
|
|
||||||
} else {
|
|
||||||
/* istanbul ignore next */
|
|
||||||
throw err
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onWarn: __DEV__ ? onError : NOOP
|
|
||||||
} as CompilerOptions,
|
} as CompilerOptions,
|
||||||
options
|
options
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
function onError(err: CompilerError) {
|
function onError(err: CompilerError, asWarning = false) {
|
||||||
const message = `Template compilation error: ${err.message}`
|
const message = asWarning
|
||||||
|
? err.message
|
||||||
|
: `Template compilation error: ${err.message}`
|
||||||
const codeFrame =
|
const codeFrame =
|
||||||
err.loc &&
|
err.loc &&
|
||||||
generateCodeFrame(
|
generateCodeFrame(
|
||||||
|
@ -49,22 +49,17 @@ function compileToFunction(
|
|||||||
extend(
|
extend(
|
||||||
{
|
{
|
||||||
hoistStatic: true,
|
hoistStatic: true,
|
||||||
onError(err) {
|
onError: __DEV__ ? onError : undefined,
|
||||||
if (__DEV__) {
|
onWarn: __DEV__ ? e => onError(e, true) : NOOP
|
||||||
onError(err)
|
|
||||||
} else {
|
|
||||||
/* istanbul ignore next */
|
|
||||||
throw err
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onWarn: __DEV__ ? onError : NOOP
|
|
||||||
} as CompilerOptions,
|
} as CompilerOptions,
|
||||||
options
|
options
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
function onError(err: CompilerError) {
|
function onError(err: CompilerError, asWarning = false) {
|
||||||
const message = `Template compilation error: ${err.message}`
|
const message = asWarning
|
||||||
|
? err.message
|
||||||
|
: `Template compilation error: ${err.message}`
|
||||||
const codeFrame =
|
const codeFrame =
|
||||||
err.loc &&
|
err.loc &&
|
||||||
generateCodeFrame(
|
generateCodeFrame(
|
||||||
|
Loading…
Reference in New Issue
Block a user