File tree Expand file tree Collapse file tree
packages/webpack-plugin/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ' @vanilla-extract/webpack-plugin ' : patch
3+ ' @vanilla-extract/next-plugin ' : patch
4+ ---
5+
6+ Fixes a bug where the ` externals ` option was silently ignored
Original file line number Diff line number Diff line change 11import type { LoaderContext } from './types' ;
22import createCompat from './compat' ;
33
4- // Should be "ExternalsItem" but webpack doesn't expose it
4+ // Webpack exposes the `Externals` type which is a union of several types.
5+ // We likely intended to only accept a subset of these, but chose to use `any`.
6+ // We handle potential array inputs, but really we should be more specific about what we accept
7+ // here, or handling all types. Changing this type would be a breaking change,
8+ // so we can look at this in a future major release.
59type Externals = any ;
610
711interface CompilationResult {
@@ -131,7 +135,7 @@ function compileVanillaSource(
131135 new ExternalsPlugin ( 'commonjs' , [
132136 '@vanilla-extract/css' ,
133137 '@vanilla-extract/css/fileScope' ,
134- externals ,
138+ ... ( Array . isArray ( externals ) ? externals : [ externals ] ) ,
135139 ] ) . apply ( childCompiler ) ;
136140
137141 let source : string ;
You can’t perform that action at this time.
0 commit comments