@@ -63,7 +63,6 @@ exports.transform = (file, processor, opts = {}) => {
6363 const details = processor . files [ file ] ;
6464 const { graph } = processor ;
6565
66- const relativeId = relative ( processor . options . cwd , id ) ;
6766 const dependencies = new Set ( ) ;
6867
6968 // Only want direct dependencies and any first-level dependencies
@@ -99,7 +98,7 @@ exports.transform = (file, processor, opts = {}) => {
9998 // create import statements for all of the values used in compositions
10099 dependencies . forEach ( ( depKey ) => {
101100 const data = graph . getNodeData ( depKey ) ;
102- const { file : depFile } = data ;
101+ const { file : depFile } = data ;
103102
104103 if ( ! importsMap . has ( depFile ) ) {
105104 importsMap . set ( depFile , new Map ( ) ) ;
@@ -165,7 +164,7 @@ exports.transform = (file, processor, opts = {}) => {
165164 if ( ! imports . size ) {
166165 return ;
167166 }
168-
167+
169168 const names = [ ...imports ] . map ( ( [ key , value ] ) => esm ( key , value ) ) ;
170169
171170 out . push ( `import { ${ names . join ( ", " ) } } from "${ slash ( from ) } ";` ) ;
@@ -260,7 +259,7 @@ exports.transform = (file, processor, opts = {}) => {
260259 }
261260
262261 throw new ReferenceError(
263- key + " is not exported by " + ${ JSON . stringify ( relativeId ) }
262+ key + " is not exported by " + ${ JSON . stringify ( relative ( processor . options . cwd , id ) ) }
264263 );
265264 }
266265 })
@@ -282,7 +281,7 @@ exports.transform = (file, processor, opts = {}) => {
282281 ` ) ) ;
283282
284283 if ( options . styleExport ) {
285- out . push ( `export var styles = ${ JSON . stringify ( details . result . css ) } ;` ) ;
284+ out . push ( `export const styles = ${ JSON . stringify ( details . result . css ) } ;` ) ;
286285 }
287286
288287 const code = out . join ( "\n" ) ;
0 commit comments