@vixoniccom/module-packager 2.13.0-dev.1 → 2.13.0-test.1
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/main.js +0 -1
- package/dist/webpack.config.js +3 -9
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -13,7 +13,6 @@ import { Configuration } from '@vixoniccom/modules';
|
|
|
13
13
|
import tsNode from 'ts-node';
|
|
14
14
|
import { createRequire } from 'module';
|
|
15
15
|
import which from 'which';
|
|
16
|
-
import 'dotenv/config';
|
|
17
16
|
const __filename = fileURLToPath(import.meta.url);
|
|
18
17
|
const __dirname = path.dirname(__filename);
|
|
19
18
|
const electronPath = path.join(__dirname, 'electron.js');
|
package/dist/webpack.config.js
CHANGED
|
@@ -5,6 +5,7 @@ import { CleanWebpackPlugin } from 'clean-webpack-plugin';
|
|
|
5
5
|
import CopyWebpackPlugin from 'copy-webpack-plugin';
|
|
6
6
|
import TerserPlugin from 'terser-webpack-plugin';
|
|
7
7
|
import webpack from 'webpack';
|
|
8
|
+
import 'dotenv/config';
|
|
8
9
|
export default (env = {}, argv = {}) => {
|
|
9
10
|
const require = createRequire(import.meta.url);
|
|
10
11
|
const options = {
|
|
@@ -19,14 +20,6 @@ export default (env = {}, argv = {}) => {
|
|
|
19
20
|
const controllerStaticPath = path.resolve(path.dirname(controllerHtmlPath), '../static');
|
|
20
21
|
const controllerFontsPath = path.resolve(path.dirname(controllerHtmlPath), '../fonts');
|
|
21
22
|
const controllerTestPath = path.resolve(options.src, 'test');
|
|
22
|
-
// Process all environment variables
|
|
23
|
-
const getEnvironmentVariables = () => {
|
|
24
|
-
const envVars = {};
|
|
25
|
-
Object.keys(process.env).forEach((key) => {
|
|
26
|
-
envVars[`process.env.${key}`] = JSON.stringify(process.env[key]);
|
|
27
|
-
});
|
|
28
|
-
return envVars;
|
|
29
|
-
};
|
|
30
23
|
return {
|
|
31
24
|
mode: isDev ? 'development' : 'production',
|
|
32
25
|
target: options.target ?? 'electron-renderer',
|
|
@@ -108,7 +101,8 @@ export default (env = {}, argv = {}) => {
|
|
|
108
101
|
plugins: [
|
|
109
102
|
new webpack.DefinePlugin({
|
|
110
103
|
global: 'globalThis',
|
|
111
|
-
|
|
104
|
+
// env variables
|
|
105
|
+
'process.env.AQI_TOKEN': JSON.stringify(process.env.AQI_TOKEN || ''),
|
|
112
106
|
}),
|
|
113
107
|
new webpack.ProvidePlugin({
|
|
114
108
|
process: 'process/browser.js',
|