@@ -11,6 +11,7 @@ import resolveConfig from './util/resolveConfig'
1111import getAllConfigs from './util/getAllConfigs'
1212import { supportedConfigFiles } from './constants'
1313import defaultConfig from '../stubs/defaultConfig.stub.js'
14+ import log from './util/log'
1415
1516function resolveConfigPath ( filePath ) {
1617 // require('tailwindcss')({ theme: ..., variants: ... })
@@ -65,20 +66,27 @@ const getConfigFunction = (config) => () => {
6566}
6667
6768module . exports = function ( config ) {
68- const plugins = [ ]
6969 const resolvedConfigPath = resolveConfigPath ( config )
70+ const getConfig = getConfigFunction ( resolvedConfigPath || config )
71+ const mode = _ . get ( getConfig ( ) , 'mode' , 'aot' )
72+
73+ 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+ ] )
78+ return require ( '../jit/index.js' ) ( config )
79+ }
80+
81+ const plugins = [ ]
7082
7183 if ( ! _ . isUndefined ( resolvedConfigPath ) ) {
7284 plugins . push ( registerConfigAsDependency ( resolvedConfigPath ) )
7385 }
7486
7587 return {
7688 postcssPlugin : 'tailwindcss' ,
77- plugins : [
78- ...plugins ,
79- processTailwindFeatures ( getConfigFunction ( resolvedConfigPath || config ) ) ,
80- formatCSS ,
81- ] ,
89+ plugins : [ ...plugins , processTailwindFeatures ( getConfig ) , formatCSS ] ,
8290 }
8391}
8492
0 commit comments