fix: Add back pnpm support
parent
e713b2bed8
commit
7ba8b4d8f8
|
@ -5,9 +5,10 @@ import { isObject } from './isObject'
|
|||
import { withUserEnvironment } from './environment'
|
||||
|
||||
export async function getBuiltInPlugins({ cwd, resolvedConfig }) {
|
||||
return withUserEnvironment(cwd, ({ require }) => {
|
||||
return withUserEnvironment(cwd, ({ require, resolve }) => {
|
||||
const tailwindBase = path.dirname(resolve('tailwindcss/package.json'))
|
||||
try {
|
||||
return require('tailwindcss/lib/corePlugins.js').default({
|
||||
return require('./lib/corePlugins.js', tailwindBase).default({
|
||||
corePlugins: resolvedConfig.corePlugins,
|
||||
})
|
||||
} catch (_) {
|
||||
|
|
|
@ -184,7 +184,8 @@ function loadMeta(configDir) {
|
|||
let featureFlags
|
||||
|
||||
try {
|
||||
featureFlags = require('tailwindcss/lib/featureFlags.js').default
|
||||
const tailwindBase = path.dirname(resolve('tailwindcss/package.json'))
|
||||
featureFlags = require('./lib/featureFlags.js', tailwindBase).default
|
||||
} catch (_) {}
|
||||
|
||||
return { version, featureFlags }
|
||||
|
|
|
@ -12,13 +12,14 @@ export default function resolveConfig({ cwd, config }) {
|
|||
}
|
||||
|
||||
let resolve = (x) => x
|
||||
withUserEnvironment(cwd, ({ require }) => {
|
||||
withUserEnvironment(cwd, ({ require, resolve }) => {
|
||||
const tailwindBase = path.dirname(resolve('tailwindcss/package.json'))
|
||||
try {
|
||||
resolve = require('tailwindcss/resolveConfig.js')
|
||||
resolve = require('./resolveConfig.js', tailwindBase)
|
||||
} catch (_) {
|
||||
try {
|
||||
const resolveConfig = require('tailwindcss/lib/util/resolveConfig.js')
|
||||
const defaultConfig = require('tailwindcss/stubs/defaultConfig.stub.js')
|
||||
const resolveConfig = require('./lib/util/resolveConfig.js', tailwindBase)
|
||||
const defaultConfig = require('./stubs/defaultConfig.stub.js', tailwindBase)
|
||||
resolve = (config) => resolveConfig([config, defaultConfig])
|
||||
} catch (_) {}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue