Prechádzať zdrojové kódy

Bugfix: auto webpack problems fixed.

lfabl 1 týždeň pred
rodič
commit
aea1925b5b
1 zmenil súbory, kde vykonal 11 pridanie a 2 odobranie
  1. 11 2
      webpack-config.js

+ 11 - 2
webpack-config.js

@@ -1,4 +1,5 @@
 /* eslint-disable @typescript-eslint/no-require-imports */
+const fs = require("fs");
 const path = require("path");
 
 function withNCoreUIKitWebpack(config, webpack) {
@@ -56,7 +57,7 @@ function withNCoreUIKitWebpack(config, webpack) {
     if(webpack) {
         config.plugins.push(
             new webpack.ProvidePlugin({
-                process: "process/browser",
+                process: "process/browser.js",
                 Buffer: [
                     "buffer",
                     "Buffer"
@@ -107,6 +108,14 @@ function createDefaultWebpackConfig({
         }
     };
 
+    const fullySpecifiedIncludes = [
+        /node_modules\/ncore-ui-kit/
+    ];
+
+    if(fs.existsSync(path.resolve(appDirectory, "node_modules", "@react-navigation"))) {
+        fullySpecifiedIncludes.push(/node_modules\/@react-navigation/);
+    }
+
     let config = {
         plugins: [
             new webpack.DefinePlugin({
@@ -122,7 +131,7 @@ function createDefaultWebpackConfig({
                 babelLoaderConfiguration,
                 imageLoaderConfiguration,
                 {
-                    include: /node_modules\/@react-navigation/,
+                    include: fullySpecifiedIncludes,
                     resolve: {
                         fullySpecified: false
                     },