@vanilla-extract/esbuild-plugin
Advanced tools
Comparing version 2.0.5 to 2.1.0
@@ -1,5 +0,8 @@ | ||
import { IdentifierOption } from '@vanilla-extract/integration'; | ||
import { IdentifierOption, CompileOptions } from '@vanilla-extract/integration'; | ||
import type { Plugin } from 'esbuild'; | ||
interface VanillaExtractPluginOptions { | ||
outputCss?: boolean; | ||
/** | ||
* @deprecated Use `esbuildOptions.external` instead. | ||
*/ | ||
externals?: Array<string>; | ||
@@ -9,4 +12,5 @@ runtime?: boolean; | ||
identifiers?: IdentifierOption; | ||
esbuildOptions?: CompileOptions['esbuildOptions']; | ||
} | ||
export declare function vanillaExtractPlugin({ outputCss, externals, runtime, processCss, identifiers, }?: VanillaExtractPluginOptions): Plugin; | ||
export declare function vanillaExtractPlugin({ outputCss, externals, runtime, processCss, identifiers, esbuildOptions, }?: VanillaExtractPluginOptions): Plugin; | ||
export {}; |
@@ -14,3 +14,4 @@ 'use strict'; | ||
processCss, | ||
identifiers | ||
identifiers, | ||
esbuildOptions | ||
} = {}) { | ||
@@ -64,2 +65,16 @@ if (runtime) { | ||
}) => { | ||
var _esbuildOptions; | ||
const combinedEsbuildOptions = (_esbuildOptions = { ...esbuildOptions | ||
}) !== null && _esbuildOptions !== void 0 ? _esbuildOptions : {}; // To avoid a breaking change this combines the `external` option from | ||
// esbuildOptions with the pre-existing externals option. | ||
if (externals) { | ||
if (combinedEsbuildOptions.external) { | ||
combinedEsbuildOptions.external.push(...externals); | ||
} else { | ||
combinedEsbuildOptions.external = externals; | ||
} | ||
} | ||
const { | ||
@@ -70,4 +85,4 @@ source, | ||
filePath: path, | ||
externals, | ||
cwd: build.initialOptions.absWorkingDir | ||
cwd: build.initialOptions.absWorkingDir, | ||
esbuildOptions: combinedEsbuildOptions | ||
}); | ||
@@ -74,0 +89,0 @@ const contents = await integration.processVanillaFile({ |
@@ -14,3 +14,4 @@ 'use strict'; | ||
processCss, | ||
identifiers | ||
identifiers, | ||
esbuildOptions | ||
} = {}) { | ||
@@ -64,2 +65,16 @@ if (runtime) { | ||
}) => { | ||
var _esbuildOptions; | ||
const combinedEsbuildOptions = (_esbuildOptions = { ...esbuildOptions | ||
}) !== null && _esbuildOptions !== void 0 ? _esbuildOptions : {}; // To avoid a breaking change this combines the `external` option from | ||
// esbuildOptions with the pre-existing externals option. | ||
if (externals) { | ||
if (combinedEsbuildOptions.external) { | ||
combinedEsbuildOptions.external.push(...externals); | ||
} else { | ||
combinedEsbuildOptions.external = externals; | ||
} | ||
} | ||
const { | ||
@@ -70,4 +85,4 @@ source, | ||
filePath: path, | ||
externals, | ||
cwd: build.initialOptions.absWorkingDir | ||
cwd: build.initialOptions.absWorkingDir, | ||
esbuildOptions: combinedEsbuildOptions | ||
}); | ||
@@ -74,0 +89,0 @@ const contents = await integration.processVanillaFile({ |
@@ -10,3 +10,4 @@ import { dirname, join } from 'path'; | ||
processCss, | ||
identifiers | ||
identifiers, | ||
esbuildOptions | ||
} = {}) { | ||
@@ -60,2 +61,16 @@ if (runtime) { | ||
}) => { | ||
var _esbuildOptions; | ||
const combinedEsbuildOptions = (_esbuildOptions = { ...esbuildOptions | ||
}) !== null && _esbuildOptions !== void 0 ? _esbuildOptions : {}; // To avoid a breaking change this combines the `external` option from | ||
// esbuildOptions with the pre-existing externals option. | ||
if (externals) { | ||
if (combinedEsbuildOptions.external) { | ||
combinedEsbuildOptions.external.push(...externals); | ||
} else { | ||
combinedEsbuildOptions.external = externals; | ||
} | ||
} | ||
const { | ||
@@ -66,4 +81,4 @@ source, | ||
filePath: path, | ||
externals, | ||
cwd: build.initialOptions.absWorkingDir | ||
cwd: build.initialOptions.absWorkingDir, | ||
esbuildOptions: combinedEsbuildOptions | ||
}); | ||
@@ -70,0 +85,0 @@ const contents = await processVanillaFile({ |
{ | ||
"name": "@vanilla-extract/esbuild-plugin", | ||
"version": "2.0.5", | ||
"version": "2.1.0", | ||
"description": "Zero-runtime Stylesheets-in-TypeScript", | ||
@@ -18,3 +18,3 @@ "main": "dist/vanilla-extract-esbuild-plugin.cjs.js", | ||
"dependencies": { | ||
"@vanilla-extract/integration": "^4.0.1" | ||
"@vanilla-extract/integration": "^5.0.0" | ||
}, | ||
@@ -21,0 +21,0 @@ "devDependencies": { |
@@ -91,2 +91,3 @@ # 🧁 vanilla-extract | ||
- [identifiers](#identifiers) | ||
- [esbuildOptions](#esbuildoptions) | ||
- [Styling API](#styling-api) | ||
@@ -397,2 +398,8 @@ - [style](#style) | ||
### esbuildOptions | ||
> Only for `esbuild`, `vite` and `rollup` plugins | ||
esbuild is used internally to compile `.css.ts` files before evaluating them to extract styles. You can pass additional options here to customize that process. | ||
Accepts a subset of esbuild build options (`plugins`, `external`, `define` and `loader`), see https://esbuild.github.io/api/#build-api. | ||
--- | ||
@@ -399,0 +406,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
40454
290
1233
+ Added@vanilla-extract/integration@5.0.1(transitive)
- Removed@vanilla-extract/integration@4.0.1(transitive)