@fto-consult/expo-ui 6.18.2 → 6.18.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/babel.config.js +6 -0
- package/metro.config.js +0 -1
- package/package.json +1 -1
- package/readMe.md +1 -1
- package/webpack.config.js +1 -13
package/babel.config.js
CHANGED
|
@@ -10,7 +10,12 @@ module.exports = function(api,opts) {
|
|
|
10
10
|
const fs = require("fs");
|
|
11
11
|
const dir = path.resolve(__dirname);
|
|
12
12
|
typeof api.cache =='function' && api.cache(true);
|
|
13
|
+
const inlineDovOptions = { unsafe: true};
|
|
13
14
|
const options = {base:dir,...opts,platform:"expo"};
|
|
15
|
+
const environmentPath = require("./copy-env-file")();
|
|
16
|
+
if(fs.existsSync(environmentPath)){
|
|
17
|
+
inlineDovOptions.path ='./.env';
|
|
18
|
+
}
|
|
14
19
|
/*** par défaut, les variables d'environnements sont stockés dans le fichier .env situé à la racine du projet, référencée par la prop base */
|
|
15
20
|
const alias = require("./babel.config.alias")(options);
|
|
16
21
|
const $eelectron = alias.$eelectron || null;
|
|
@@ -75,6 +80,7 @@ module.exports = function(api,opts) {
|
|
|
75
80
|
['babel-preset-expo']
|
|
76
81
|
],
|
|
77
82
|
plugins : [
|
|
83
|
+
["inline-dotenv",inlineDovOptions],
|
|
78
84
|
["module-resolver", {"alias": alias}],
|
|
79
85
|
['react-native-reanimated/plugin'],
|
|
80
86
|
],
|
package/metro.config.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const path = require("path");
|
|
2
2
|
const fs = require("fs");
|
|
3
|
-
require("./copy-env-file")();
|
|
4
3
|
module.exports = function(opts){
|
|
5
4
|
const nodeModulePath = `${process.cwd()}/node_modules`;
|
|
6
5
|
const mConfigPath = fs.existsSync(`${nodeModulePath}/@expo/metro-config`) && `${nodeModulePath}/@expo/metro-config` || "@expo/metro-config";
|
package/package.json
CHANGED
package/readMe.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
## Installation des dépendences, packages de dévéloppement
|
|
2
2
|
|
|
3
3
|
```javascript
|
|
4
|
-
npm i --D babel-plugin-module-resolver
|
|
4
|
+
npm i --D babel-plugin-module-resolver babel-plugin-inline-dotenv @expo/metro-config @expo/webpack-config
|
|
5
5
|
```
|
|
6
6
|
|
|
7
7
|
## **#ELECTRON**
|
package/webpack.config.js
CHANGED
|
@@ -63,7 +63,7 @@ module.exports = async function(env, argv,opts) {
|
|
|
63
63
|
config.performance.maxAssetSize = typeof config.performance.maxAssetSize =='number'? config.performance.maxAssetSize : 512000;
|
|
64
64
|
config.devtool = (config.mode === 'development') ? 'inline-source-map' : false;
|
|
65
65
|
require("./compiler.config.js")({config,...opts});
|
|
66
|
-
|
|
66
|
+
require("./copy-env-file")();
|
|
67
67
|
const extensions = config.resolve.extensions;
|
|
68
68
|
if(isElectron){
|
|
69
69
|
mainExtensions.map((ex)=>{
|
|
@@ -72,18 +72,6 @@ module.exports = async function(env, argv,opts) {
|
|
|
72
72
|
extensions.unshift(nExt);
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
|
-
//const electronPath = process.cwd();
|
|
76
|
-
//config.output = config.output || {};
|
|
77
|
-
//config.output.publicPath = "./";
|
|
78
|
-
//config.output.path = path.join(electronPath,"dist");
|
|
79
|
-
//writeFile(path.resolve(__dirname,"is-electron-platform.txt"),` ${JSON.stringify(extensions)} is extensions to resolve`)
|
|
80
75
|
}
|
|
81
|
-
//fix process is not defined
|
|
82
|
-
config.plugins.unshift(new webpack.ProvidePlugin({
|
|
83
|
-
process: 'process/browser',
|
|
84
|
-
}));
|
|
85
|
-
config.resolve.alias.process = "process/browser";
|
|
86
|
-
config.resolve.fallback = typeof config.resolve.fallback =="object" && config.resolve.fallback || {};
|
|
87
|
-
config.resolve.fallback = {...config.resolve.fallback,process: require.resolve('process/browser')};
|
|
88
76
|
return config;
|
|
89
77
|
};;
|