esbuild-css-modules-plugin
Advanced tools
Comparing version 3.0.0-dev.9 to 3.0.0-dev.10
14
index.js
import { basename, dirname, extname, normalize, relative, resolve, sep } from 'node:path'; | ||
import { CSSTransformer, CSSInjector } from './lib/css.helper.js'; | ||
import { prepareBuild } from './lib/plugin.js'; | ||
import { | ||
@@ -13,6 +12,8 @@ contentPlaceholder, | ||
pluginName, | ||
simpleMinifyCss | ||
simpleMinifyCss, | ||
validateOptions | ||
} from './lib/utils.js'; | ||
import { compact } from 'lodash-es'; | ||
import { readFile, writeFile } from 'node:fs/promises'; | ||
import { patchContext } from './lib/context.js'; | ||
@@ -28,5 +29,10 @@ /** | ||
const options = _options || {}; | ||
const patchedBuild = prepareBuild(build, options); | ||
validateOptions(options); | ||
const patchedBuild = patchContext(build, options); | ||
const { log, buildId, buildRoot } = patchedBuild.context; | ||
log(`initialize build context with options:`, options); | ||
log(`root of this build(#${buildId}):`, buildRoot); | ||
const modulesCssRegExp = getModulesCssRegExp(options); | ||
const { buildRoot, log, buildId } = patchedBuild.context; | ||
const bundle = patchedBuild.initialOptions.bundle ?? false; | ||
@@ -33,0 +39,0 @@ const forceBuild = options.force ?? false; |
@@ -113,3 +113,3 @@ import { bundle as bundleModulesCss } from 'lightningcss'; | ||
async dispose() { | ||
dispose() { | ||
CSSInjector.__instances__.delete(this.build); | ||
@@ -116,0 +116,0 @@ } |
{ | ||
"name": "esbuild-css-modules-plugin", | ||
"version": "3.0.0-dev.9", | ||
"version": "3.0.0-dev.10", | ||
"description": "A esbuild plugin to bundle css modules into js(x)/ts(x).", | ||
"main": "./index.js", | ||
"main": "./index.cjs", | ||
"module": "./index.js", | ||
"types": "./index.d.ts", | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"types": "./index.d.ts", | ||
"import": "./index.js", | ||
"require": "./index.cjs", | ||
"default": "./index.js" | ||
} | ||
}, | ||
"keywords": [ | ||
@@ -34,3 +42,4 @@ "esbuild", | ||
"lightningcss": "^1.20.0", | ||
"lodash-es": "^4.17.21" | ||
"lodash-es": "^4.17.21", | ||
"lodash": "^4.17.21" | ||
}, | ||
@@ -40,2 +49,2 @@ "publishConfig": { | ||
} | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55365
1391
4
3
+ Addedlodash@^4.17.21
+ Addedlodash@4.17.21(transitive)