File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -24,23 +24,27 @@ export const unpluginFactory: UnpluginFactory<Options | undefined> = (
2424 enforce : 'pre' ,
2525
2626 transformInclude ( id ) {
27- const { file, query } = parse_ID ( id ) ;
27+ const { file, query } = parse_ID ( normalizePath ( id ) ) ;
2828 return query . raw == null && filter ( file ) ;
2929 } ,
3030 transform ( code , id ) {
31- return transform ( code , id , opts , isWebpack ) ;
31+ return transform ( code , normalizePath ( id ) , opts , isWebpack ) ;
3232 } ,
3333 } ;
3434} ;
3535
3636function resolveOptions ( opts : Options ) : ResolvedOptions {
3737 return {
38- root : opts . root ?? process . cwd ( ) ,
38+ root : normalizePath ( opts . root ?? process . cwd ( ) ) ,
3939 sourceMap : opts . sourceMap ?? false ,
4040 babelParserPlugins : opts . babelParserPlugins ?? [ ] ,
4141 include : opts . include ?? / \. ( v u e | j s x | t s x | m d x ) $ / ,
4242 exclude : opts . exclude ?? / \/ n o d e _ m o d u l e s \/ / ,
4343 } ;
4444}
4545
46+ function normalizePath ( path : string ) {
47+ return path . replace ( / \\ / g, '/' ) ;
48+ }
49+
4650export default /* #__PURE__ */ createUnplugin ( unpluginFactory ) ;
You can’t perform that action at this time.
0 commit comments