@@ -36,10 +36,12 @@ function fromLocalWebpack(extensionPath, sourceMappingURLBase) {
3636 const result = es . through ( ) ;
3737 const packagedDependencies = [ ] ;
3838 const packageJsonConfig = require ( path . join ( extensionPath , 'package.json' ) ) ;
39- const webpackRootConfig = require ( path . join ( extensionPath , 'extension.webpack.config.js' ) ) ;
40- for ( const key in webpackRootConfig . externals ) {
41- if ( key in packageJsonConfig . dependencies ) {
42- packagedDependencies . push ( key ) ;
39+ if ( Array . isArray ( packageJsonConfig . dependencies ) ) {
40+ const webpackRootConfig = require ( path . join ( extensionPath , 'extension.webpack.config.js' ) ) ;
41+ for ( const key in webpackRootConfig . externals ) {
42+ if ( key in packageJsonConfig . dependencies ) {
43+ packagedDependencies . push ( key ) ;
44+ }
4345 }
4446 }
4547 vsce . listFiles ( { cwd : extensionPath , packageManager : vsce . PackageManager . Yarn , packagedDependencies } ) . then ( fileNames => {
@@ -68,8 +70,10 @@ function fromLocalWebpack(extensionPath, sourceMappingURLBase) {
6870 . pipe ( packageJsonFilter )
6971 . pipe ( buffer ( ) )
7072 . pipe ( json ( ( data ) => {
71- // hardcoded entry point directory!
72- data . main = data . main . replace ( '/out/' , / d i s t / ) ;
73+ if ( data . main ) {
74+ // hardcoded entry point directory!
75+ data . main = data . main . replace ( '/out/' , / d i s t / ) ;
76+ }
7377 return data ;
7478 } ) )
7579 . pipe ( packageJsonFilter . restore ) ;
0 commit comments