Only warn about JIT engine once
This commit is contained in:
parent
3bdb6d3707
commit
e8adab7ebb
1 changed files with 9 additions and 4 deletions
13
src/index.js
13
src/index.js
|
|
@ -65,16 +65,21 @@ const getConfigFunction = (config) => () => {
|
|||
return resolveConfig([...getAllConfigs(configObject)])
|
||||
}
|
||||
|
||||
let warned = false
|
||||
|
||||
module.exports = function (config) {
|
||||
const resolvedConfigPath = resolveConfigPath(config)
|
||||
const getConfig = getConfigFunction(resolvedConfigPath || config)
|
||||
const mode = _.get(getConfig(), 'mode', 'aot')
|
||||
|
||||
if (mode === 'jit') {
|
||||
log.warn([
|
||||
`You have enabled the JIT engine which is currently in preview.`,
|
||||
'Preview features are not covered by semver, may introduce breaking changes, and can change at any time.',
|
||||
])
|
||||
if (!warned) {
|
||||
log.warn([
|
||||
`You have enabled the JIT engine which is currently in preview.`,
|
||||
'Preview features are not covered by semver, may introduce breaking changes, and can change at any time.',
|
||||
])
|
||||
warned = true
|
||||
}
|
||||
return require('../jit/index.js')(config)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue