|
@@ -1,4 +1,5 @@
|
|
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
|
|
|
+const fs = require("fs");
|
|
|
const path = require("path");
|
|
const path = require("path");
|
|
|
|
|
|
|
|
function withNCoreUIKitWebpack(config, webpack) {
|
|
function withNCoreUIKitWebpack(config, webpack) {
|
|
@@ -56,7 +57,7 @@ function withNCoreUIKitWebpack(config, webpack) {
|
|
|
if(webpack) {
|
|
if(webpack) {
|
|
|
config.plugins.push(
|
|
config.plugins.push(
|
|
|
new webpack.ProvidePlugin({
|
|
new webpack.ProvidePlugin({
|
|
|
- process: "process/browser",
|
|
|
|
|
|
|
+ process: "process/browser.js",
|
|
|
Buffer: [
|
|
Buffer: [
|
|
|
"buffer",
|
|
"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 = {
|
|
let config = {
|
|
|
plugins: [
|
|
plugins: [
|
|
|
new webpack.DefinePlugin({
|
|
new webpack.DefinePlugin({
|
|
@@ -122,7 +131,7 @@ function createDefaultWebpackConfig({
|
|
|
babelLoaderConfiguration,
|
|
babelLoaderConfiguration,
|
|
|
imageLoaderConfiguration,
|
|
imageLoaderConfiguration,
|
|
|
{
|
|
{
|
|
|
- include: /node_modules\/@react-navigation/,
|
|
|
|
|
|
|
+ include: fullySpecifiedIncludes,
|
|
|
resolve: {
|
|
resolve: {
|
|
|
fullySpecified: false
|
|
fullySpecified: false
|
|
|
},
|
|
},
|