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