esbuild-css-modules-plugin
Advanced tools
Comparing version 3.0.2 to 3.0.3
@@ -0,1 +1,4 @@ | ||
## V3.0.3 | ||
- Fix sourcemap | ||
## V3.0.2 | ||
@@ -2,0 +5,0 @@ - Do not emit .d.ts for files outside of build root |
@@ -6,7 +6,6 @@ import { bundle as bundleModulesCss, transform } from 'lightningcss'; | ||
digestPlaceholder, | ||
emptySourceMap, | ||
pluginCssNamespace, | ||
validateNamedExport | ||
} from './utils.js'; | ||
import { camelCase, sortBy, uniq, uniqBy, upperFirst } from 'lodash-es'; | ||
import { camelCase, sortBy, uniqBy, upperFirst } from 'lodash-es'; | ||
import { injectorVirtualPath, pluginJsNamespace } from './utils.js'; | ||
@@ -239,5 +238,2 @@ import { readFileSync } from 'node:fs'; | ||
// https://github.com/evanw/esbuild/issues/1227 | ||
jsLines.push(`//${emptySourceMap}`); | ||
const jsContents = jsLines.join('\n'); | ||
@@ -273,3 +269,3 @@ | ||
minify: false, | ||
sourceMap: !!this.build.initialOptions.sourcemap, | ||
sourceMap: false, | ||
projectRoot: this.build.context.buildRoot, | ||
@@ -280,2 +276,4 @@ targets: { | ||
}; | ||
/** @type {{code: Buffer, exports: import('lightningcss').CSSModuleExports}} */ | ||
// @ts-ignore | ||
const r = bundleModulesCss(bundleCssConfig); | ||
@@ -296,3 +294,3 @@ | ||
const { code, map: sourcemap, exports } = r; | ||
const { code, exports } = r; | ||
@@ -332,11 +330,6 @@ let originCss = code ? code.toString('utf8') : ''; | ||
const css = | ||
originCss + | ||
(sourcemap | ||
? `\n/*# sourceMappingURL=data:application/json;base64,${sourcemap.toString('base64')} */` | ||
: ''); | ||
const { js, dts } = this.genModulesJs(exports, fullpath, !!opt?.emitDeclarationFile); | ||
/** @type {{css: string; js: string; dts?: string; composedFiles: string[]}} */ | ||
const result = { | ||
css, | ||
css: originCss, | ||
composedFiles, | ||
@@ -343,0 +336,0 @@ js, |
@@ -171,5 +171,2 @@ import { isAbsolute, resolve, sep, relative, basename, dirname } from 'node:path'; | ||
const emptySourceMap = | ||
'# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIiJdLCJtYXBwaW5ncyI6IkEifQ=='; | ||
const contentPlaceholder = '__content_placeholder__'; | ||
@@ -238,3 +235,2 @@ const digestPlaceholder = '__digest_placeholder__'; | ||
getPackageInfo, | ||
emptySourceMap, | ||
contentPlaceholder, | ||
@@ -241,0 +237,0 @@ digestPlaceholder, |
{ | ||
"name": "esbuild-css-modules-plugin", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "A esbuild plugin to bundle css modules into js(x)/ts(x), based on extremely fast [Lightning CSS](https://lightningcss.dev/)", | ||
@@ -41,3 +41,3 @@ "main": "./index.cjs", | ||
"@types/node": "^17.0.23", | ||
"esbuild": "^0.19.2" | ||
"esbuild": "^0.19.4" | ||
}, | ||
@@ -48,4 +48,3 @@ "peerDependencies": { | ||
"dependencies": { | ||
"lightningcss": "^1.21.7", | ||
"lodash": "^4.17.21", | ||
"lightningcss": "^1.22.0", | ||
"lodash-es": "^4.17.21" | ||
@@ -52,0 +51,0 @@ }, |
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
3
40935
1055
- Removedlodash@^4.17.21
- Removedlodash@4.17.21(transitive)
Updatedlightningcss@^1.22.0