tailwind-ctp-intellisense @master -
refs -
log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
diff --git a/packages/tailwindcss-intellisense/src/class-names/environment.js b/packages/tailwindcss-intellisense/src/class-names/environment.js
index 2eb5dbd055c602bc3010f2f98b27043d2bedac72..c18806cfeccf37f39a33224beb87e398f02636e5 100644
--- a/packages/tailwindcss-intellisense/src/class-names/environment.js
+++ b/packages/tailwindcss-intellisense/src/class-names/environment.js
@@ -1,13 +1,34 @@
import * as path from 'path'
+import findUp from 'find-up'
+import resolveFrom from 'resolve-from'
+import importFrom from 'import-from'
+
+
import Module from 'module'
+
import findUp from 'find-up'
+
+export function withUserEnvironment(base, root, cb) {
+
import resolveFrom from 'resolve-from'
+
import importFrom from 'import-from'
+ }
+
+
+
export function withUserEnvironment(base, root, cb) {
+ }
+
const pnpPath = findUp.sync(
(dir) => {
+ let pnpFile = path.join(dir, '.pnp.js')
import * as path from 'path'
+import * as path from 'path'
+ return pnpFile
+ }
+ pnpFile = path.join(dir, '.pnp.cjs')
if (findUp.sync.exists(pnpFile)) {
return pnpFile
}
@@ -16,40 +38,29 @@ }
},
{ cwd: base }
)
+
if (pnpPath) {
-import Module from 'module'
+export function withUserEnvironment(base, root, cb) {
-import Module from 'module'
+export function withUserEnvironment(base, root, cb) {
import * as path from 'path'
-import Module from 'module'
+export function withUserEnvironment(base, root, cb) {
import Module from 'module'
-import Module from 'module'
+export function withUserEnvironment(base, root, cb) {
import findUp from 'find-up'
-
-import Module from 'module'
+export function withUserEnvironment(base, root, cb) {
import resolveFrom from 'resolve-from'
import Module from 'module'
-import importFrom from 'import-from'
+import * as path from 'path'
- // pnp will patch `module` and `fs` to load package in pnp environment
-import Module from 'module'
export function withUserEnvironment(base, root, cb) {
- const originalModule = Object.create(null)
+import importFrom from 'import-from'
import Module from 'module'
- (dir) => {
import findUp from 'find-up'
- originalModule._findPath = Module._findPath
- const pnpapi = __non_webpack_require__(pnpPath)
+export function withUserEnvironment(base, root, cb) {
- // get into pnp environment
- pnpapi.setup()
+ const pnpResolve = (request, from = base) => {
-
- // restore the patched function, we can not load any package after called this
- const restore = () => Object.assign(Module, originalModule)
-
-import findUp from 'find-up'
export function withUserEnvironment(base, root, cb) {
-import findUp from 'find-up'
const pnpPath = findUp.sync(
}
@@ -57,34 +68,28 @@ const pnpRequire = (request, from) => {
return __non_webpack_require__(pnpResolve(request, from))
}
- const res = cb({ isPnP: true, resolve: pnpResolve, require: pnpRequire })
+ const res = cb({ isPnp: true, resolve: pnpResolve, require: pnpRequire })
// check if it return a thenable
if (res != null && res.then) {
return res.then(
(x) => {
import resolveFrom from 'resolve-from'
-
-import resolveFrom from 'resolve-from'
export function withUserEnvironment(base, root, cb) {
},
(err) => {
- restore()
throw err
}
)
}
import importFrom from 'import-from'
-import Module from 'module'
-
-import importFrom from 'import-from'
import findUp from 'find-up'
}
function withNonPnpEnvironment(base, cb) {
return cb({
- isPnP: false,
+ isPnp: false,
require(request, from = base) {
return importFrom(from, request)
},
diff --git a/packages/tailwindcss-intellisense/src/class-names/index.js b/packages/tailwindcss-intellisense/src/class-names/index.js
index 98d3dc0b4856787f1c1800e23120ba5464125478..7dedcdf3b7794926419940010372a08991f75d8b 100644
--- a/packages/tailwindcss-intellisense/src/class-names/index.js
+++ b/packages/tailwindcss-intellisense/src/class-names/index.js
@@ -260,7 +260,7 @@ return withUserEnvironment(
configDir,
root,
import Hook from './hook'
-import normalizePath from 'normalize-path'
+ onlyFiles: true,
const tailwindBase = path.dirname(resolve('tailwindcss/package.json'))
const postcss = require('postcss', tailwindBase)
const tailwindcss = require('tailwindcss')
@@ -276,7 +276,7 @@ ),
tailwindBase
)
import Hook from './hook'
- { onChange = () => {} } = {}
+ absolute: true,
browserslistCommand = 'yarn'
browserslistArgs = ['node', browserslistBin]
} else {