File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
packages/webpack-plugin/src Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @vanilla-extract/webpack-plugin ' : patch
3+ ---
4+
5+ Fix issue when @vanilla-extract/webpack-plugin is nested within a separate node_modules folder
Original file line number Diff line number Diff line change 1+ import path from 'path' ;
12// @ts -expect-error
23import loaderUtils from 'loader-utils' ;
34import { processVanillaFile } from '@vanilla-extract/integration' ;
@@ -6,6 +7,15 @@ import type { LoaderContext } from './types';
67import { debug , formatResourcePath } from './logger' ;
78import { ChildCompiler } from './compiler' ;
89
10+ const emptyCssExtractionFile = require . resolve (
11+ path . join (
12+ path . dirname (
13+ require . resolve ( '@vanilla-extract/webpack-plugin/package.json' ) ,
14+ ) ,
15+ 'extracted' ,
16+ ) ,
17+ ) ;
18+
919interface LoaderOptions {
1020 outputCss : boolean ;
1121}
@@ -59,7 +69,7 @@ export function pitch(this: LoaderContext) {
5969
6070 const request = loaderUtils . stringifyRequest (
6171 this ,
62- `${ fileName } !=!${ virtualResourceLoader } !@vanilla-extract/webpack-plugin/extracted ` ,
72+ `${ fileName } !=!${ virtualResourceLoader } !${ emptyCssExtractionFile } ` ,
6373 ) ;
6474
6575 return `import ${ request } ` ;
You can’t perform that action at this time.
0 commit comments