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'
3
3
import pkgUp from 'pkg-up'
4
4
import { glob } from './glob'
5
5
import { isObject } from './isObject'
6
+ import importFrom from 'import-from'
6
7
7
- export async function getBuiltInPlugins ( cwd ) {
8
+ export async function getBuiltInPlugins ( { cwd, resolvedConfig } ) {
8
9
try {
9
- // TODO: just require('tailwindcss/lib/corePlugins.js') instead of globbing
10
10
// 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
+ } )
21
14
} catch ( _ ) {
22
15
return [ ]
23
16
}
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ const proxyHandler = (base = []) => ({
19
19
} )
20
20
21
21
export async function getUtilityConfigMap ( { cwd, resolvedConfig, postcss } ) {
22
- const builtInPlugins = await getBuiltInPlugins ( cwd )
22
+ const builtInPlugins = await getBuiltInPlugins ( { cwd, resolvedConfig } )
23
23
const userPlugins = Array . isArray ( resolvedConfig . plugins )
24
24
? resolvedConfig . plugins
25
25
: [ ]
You can’t perform that action at this time.
0 commit comments