Skip to content

Commit e8adab7

Browse files
committed
Only warn about JIT engine once
1 parent 3bdb6d3 commit e8adab7

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/index.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,21 @@ const getConfigFunction = (config) => () => {
6565
return resolveConfig([...getAllConfigs(configObject)])
6666
}
6767

68+
let warned = false
69+
6870
module.exports = function (config) {
6971
const resolvedConfigPath = resolveConfigPath(config)
7072
const getConfig = getConfigFunction(resolvedConfigPath || config)
7173
const mode = _.get(getConfig(), 'mode', 'aot')
7274

7375
if (mode === 'jit') {
74-
log.warn([
75-
`You have enabled the JIT engine which is currently in preview.`,
76-
'Preview features are not covered by semver, may introduce breaking changes, and can change at any time.',
77-
])
76+
if (!warned) {
77+
log.warn([
78+
`You have enabled the JIT engine which is currently in preview.`,
79+
'Preview features are not covered by semver, may introduce breaking changes, and can change at any time.',
80+
])
81+
warned = true
82+
}
7883
return require('../jit/index.js')(config)
7984
}
8085

0 commit comments

Comments
 (0)