@@ -30,31 +30,29 @@ const checkFramework = () => {
3030 name : 'webpack.config.js' ,
3131 version : 5
3232 } ;
33- // As of 9/9/2021, Capacitor 3.0.0:
34- // angular: webpack5
35- // react: webpack4
36- // vue: webpack4
37- const packagePath = join ( projectDir , 'package.json' ) ;
38- const packageContent = fs . readFileSync ( packagePath , {
39- encoding : 'UTF-8' ,
40- } ) ;
41- if ( packageContent ) {
42- const packageJson = JSON . parse (
43- stripJsonComments ( packageContent ) ,
44- ) ;
45- if ( packageJson && packageJson . dependencies ) {
46- isReact = ! ! packageJson . dependencies [ 'react' ] ;
47- isVue = ! ! packageJson . dependencies [ 'vue' ] ;
48- if ( isReact || isVue ) {
49- webpackInfo = {
50- name : 'webpack4.config.js' ,
51- version : 4
52- } ;
53- } else {
54- isAngular = true ;
55- }
56- }
57- }
33+
34+ // Note: Left here in case other flavor integrations end up using older webpack
35+ // const packagePath = join(projectDir, 'package.json');
36+ // const packageContent = fs.readFileSync(packagePath, {
37+ // encoding: 'UTF-8',
38+ // });
39+ // if (packageContent) {
40+ // const packageJson = JSON.parse(
41+ // stripJsonComments(packageContent),
42+ // );
43+ // if (packageJson && packageJson.dependencies) {
44+ // isReact = !!packageJson.dependencies['react'];
45+ // isVue = !!packageJson.dependencies['vue'];
46+ // if (isVue) {
47+ // webpackInfo = {
48+ // name: 'webpack4.config.js',
49+ // version: 4
50+ // };
51+ // } else {
52+ // isAngular = true;
53+ // }
54+ // }
55+ // }
5856} ;
5957
6058const buildNativeScript = ( ) => {
@@ -128,26 +126,27 @@ const npmInstallTsPatch = () => {
128126
129127const npmInstall = ( ) => {
130128
131- if ( isReact ) {
132- // Exception case: React needs ts-loader ^6.2.2 installed
133- const child = spawn ( `npm` , [ 'install' , '[email protected] ' , '-D' ] , { 134- cwd : resolve ( buildDir ) ,
135- stdio : 'inherit' ,
136- shell : true ,
137- } ) ;
138- child . on ( 'error' , ( error ) => {
139- console . log ( 'NativeScript build error:' , error ) ;
140- } ) ;
141- child . on ( 'close' , ( res ) => {
142- child . kill ( ) ;
143- installTsPatch ( ) ;
144- } ) ;
145- } else {
129+ // Note: Left in case flavor integrations need any different dependencies in future
130+ // if (isReact) {
131+ // // Exception case: React needs ts-loader ^6.2.2 installed
132+ // const child = spawn(`npm`, ['install', '[email protected] ', '-D'], { 133+ // cwd: resolve(buildDir),
134+ // stdio: 'inherit',
135+ // shell: true,
136+ // });
137+ // child.on('error', (error) => {
138+ // console.log('NativeScript build error:', error);
139+ // });
140+ // child.on('close', (res) => {
141+ // child.kill();
142+ // installTsPatch();
143+ // });
144+ // } else {
146145 // Vue projects bring in ts-loader 6.2.2 through vue cli dependencies
147146 // Angular project use webpack5 and can use the latest with @nativescript /webpack
148147 // proceed as normal
149148 npmInstallTsPatch ( ) ;
150- }
149+ // }
151150}
152151
153152if ( ! installOnly ) {
0 commit comments