File tree Expand file tree Collapse file tree 2 files changed +6
-13
lines changed
packages/tailwindcss-class-names/src Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -3,21 +3,14 @@ import stackTrace from 'stack-trace'
33import pkgUp from 'pkg-up'
44import { glob } from './glob'
55import { isObject } from './isObject'
6+ import importFrom from 'import-from'
67
7- export async function getBuiltInPlugins ( cwd ) {
8+ export async function getBuiltInPlugins ( { cwd, resolvedConfig } ) {
89 try {
9- // TODO: just require('tailwindcss/lib/corePlugins.js') instead of globbing
1010 // TODO: add v0 support ("generators")
11- return (
12- await glob ( path . resolve ( cwd , 'node_modules/tailwindcss/lib/plugins/*.js' ) )
13- )
14- . map ( ( x ) => {
15- try {
16- const mod = __non_webpack_require__ ( x )
17- return mod . default ? mod . default ( ) : mod ( )
18- } catch ( _ ) { }
19- } )
20- . filter ( Boolean )
11+ return importFrom ( cwd , 'tailwindcss/lib/corePlugins.js' ) . default ( {
12+ corePlugins : resolvedConfig . corePlugins ,
13+ } )
2114 } catch ( _ ) {
2215 return [ ]
2316 }
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ const proxyHandler = (base = []) => ({
1919} )
2020
2121export async function getUtilityConfigMap ( { cwd, resolvedConfig, postcss } ) {
22- const builtInPlugins = await getBuiltInPlugins ( cwd )
22+ const builtInPlugins = await getBuiltInPlugins ( { cwd, resolvedConfig } )
2323 const userPlugins = Array . isArray ( resolvedConfig . plugins )
2424 ? resolvedConfig . plugins
2525 : [ ]
You can’t perform that action at this time.
0 commit comments