@vixoniccom/module-packager 2.13.0-test.5 → 2.13.0
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 +9 -0
- package/package.json +3 -2
package/dist/webpack.config.js
CHANGED
|
@@ -19,6 +19,14 @@ export default (env = {}, argv = {}) => {
|
|
|
19
19
|
const controllerStaticPath = path.resolve(path.dirname(controllerHtmlPath), '../static');
|
|
20
20
|
const controllerFontsPath = path.resolve(path.dirname(controllerHtmlPath), '../fonts');
|
|
21
21
|
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
|
+
};
|
|
22
30
|
return {
|
|
23
31
|
mode: isDev ? 'development' : 'production',
|
|
24
32
|
target: options.target ?? 'electron-renderer',
|
|
@@ -100,6 +108,7 @@ export default (env = {}, argv = {}) => {
|
|
|
100
108
|
plugins: [
|
|
101
109
|
new webpack.DefinePlugin({
|
|
102
110
|
global: 'globalThis',
|
|
111
|
+
...getEnvironmentVariables(),
|
|
103
112
|
}),
|
|
104
113
|
new webpack.ProvidePlugin({
|
|
105
114
|
process: 'process/browser.js',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vixoniccom/module-packager",
|
|
3
|
-
"version": "2.13.0
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"bin": {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"scripts": {
|
|
14
14
|
"start": "electron dist/electron.js --mode run --build ./dist/build",
|
|
15
15
|
"clean": "rimraf dist",
|
|
16
|
+
"prepublish": "npm run build",
|
|
16
17
|
"build:main": "tsc -p tsconfig.json --outDir dist",
|
|
17
18
|
"build:renderer": "webpack --config webpack.config.js --env src=./ --env build=./dist/build --mode production",
|
|
18
19
|
"copy:launcher": "cpy launcher.html dist",
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
"@electron/remote": "^2.1.2",
|
|
27
28
|
"@types/which": "^3.0.4",
|
|
28
29
|
"@vixoniccom/module-controller": "^2.0.0",
|
|
29
|
-
"@vixoniccom/modules": "^2.
|
|
30
|
+
"@vixoniccom/modules": "^2.21.0",
|
|
30
31
|
"archiver": "^5.3.0",
|
|
31
32
|
"clean-webpack-plugin": "^4.0.0",
|
|
32
33
|
"cli-color": "^1.2.0",
|