@vixoniccom/module-packager 2.13.0-test.4 → 2.13.0-test.6
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/dist/webpack.config.js +10 -2
- package/package.json +1 -1
package/dist/webpack.config.js
CHANGED
|
@@ -15,6 +15,15 @@ export default (env = {}, argv = {}) => {
|
|
|
15
15
|
};
|
|
16
16
|
const isDev = options.mode === 'development' || argv.watch === true || process.env.NODE_ENV === 'development';
|
|
17
17
|
const buildPath = path.resolve(options.build);
|
|
18
|
+
// Process all environment variables
|
|
19
|
+
const getEnvironmentVariables = () => {
|
|
20
|
+
const envVars = {};
|
|
21
|
+
Object.keys(process.env).forEach((key) => {
|
|
22
|
+
envVars[`process.env.${key}`] = JSON.stringify(process.env[key]);
|
|
23
|
+
});
|
|
24
|
+
console.log('Environment variables found:', Object.keys(process.env).length);
|
|
25
|
+
return envVars;
|
|
26
|
+
};
|
|
18
27
|
const controllerHtmlPath = path.resolve(options.src, 'index.html');
|
|
19
28
|
const controllerStaticPath = path.resolve(path.dirname(controllerHtmlPath), '../static');
|
|
20
29
|
const controllerFontsPath = path.resolve(path.dirname(controllerHtmlPath), '../fonts');
|
|
@@ -100,8 +109,7 @@ export default (env = {}, argv = {}) => {
|
|
|
100
109
|
plugins: [
|
|
101
110
|
new webpack.DefinePlugin({
|
|
102
111
|
global: 'globalThis',
|
|
103
|
-
|
|
104
|
-
'process.env.AQI_TOKEN': JSON.stringify(process.env.AQI_TOKEN || ''),
|
|
112
|
+
...getEnvironmentVariables(),
|
|
105
113
|
}),
|
|
106
114
|
new webpack.ProvidePlugin({
|
|
107
115
|
process: 'process/browser.js',
|