piral-instance-webpack-plugin 0.8.0 → 0.15.0-beta.3607
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/LICENSE +1 -1
- package/lib/helpers.js +3 -4
- package/lib/helpers.js.map +1 -1
- package/lib/index.js +14 -26
- package/lib/index.js.map +1 -1
- package/package.json +22 -11
- package/tsconfig.json +0 -9
package/LICENSE
CHANGED
package/lib/helpers.js
CHANGED
|
@@ -13,13 +13,12 @@ function getVariables(name, version, externals, env) {
|
|
|
13
13
|
}
|
|
14
14
|
exports.getVariables = getVariables;
|
|
15
15
|
function setEnvironment(variables) {
|
|
16
|
-
Object.keys(variables).forEach(
|
|
16
|
+
Object.keys(variables).forEach(key => (process.env[key] = variables[key]));
|
|
17
17
|
}
|
|
18
18
|
exports.setEnvironment = setEnvironment;
|
|
19
19
|
function getDefineVariables(variables) {
|
|
20
|
-
return Object.entries(variables).reduce(
|
|
21
|
-
|
|
22
|
-
obj["process.env." + name] = JSON.stringify(value);
|
|
20
|
+
return Object.entries(variables).reduce((obj, [name, value]) => {
|
|
21
|
+
obj[`process.env.${name}`] = JSON.stringify(value);
|
|
23
22
|
return obj;
|
|
24
23
|
}, {});
|
|
25
24
|
}
|
package/lib/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;;AAAA,SAAgB,YAAY,CAC1B,IAAY,EACZ,OAAe,EACf,SAAwB,EACxB,GAAW;IAEX,OAAO;QACL,QAAQ,EAAE,GAAG;QACb,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,YAAY,EAAE;QACrC,eAAe,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACzC,kBAAkB,EAAE,OAAO;QAC3B,eAAe,EAAE,IAAI;QACrB,mBAAmB,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC;KACzC,CAAC;AACJ,CAAC;AAdD,oCAcC;AAED,SAAgB,cAAc,CAAC,SAAiC;IAC9D,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;;AAAA,SAAgB,YAAY,CAC1B,IAAY,EACZ,OAAe,EACf,SAAwB,EACxB,GAAW;IAEX,OAAO;QACL,QAAQ,EAAE,GAAG;QACb,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,YAAY,EAAE;QACrC,eAAe,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACzC,kBAAkB,EAAE,OAAO;QAC3B,eAAe,EAAE,IAAI;QACrB,mBAAmB,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC;KACzC,CAAC;AACJ,CAAC;AAdD,oCAcC;AAED,SAAgB,cAAc,CAAC,SAAiC;IAC9D,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC7E,CAAC;AAFD,wCAEC;AAED,SAAgB,kBAAkB,CAAC,SAAiC;IAClE,OAAO,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE;QAC7D,GAAG,CAAC,eAAe,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACnD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AALD,gDAKC"}
|
package/lib/index.js
CHANGED
|
@@ -1,40 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.PiralInstanceWebpackPlugin = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
const webpack_1 = require("webpack");
|
|
5
|
+
const helpers_1 = require("./helpers");
|
|
6
|
+
const pluginName = 'PiralInstanceWebpackPlugin';
|
|
7
|
+
class PiralInstanceWebpackPlugin {
|
|
8
|
+
constructor(options) {
|
|
20
9
|
this.options = options;
|
|
21
10
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
apply(compiler) {
|
|
12
|
+
const { name, version, debug, emulator, externals } = this.options;
|
|
13
|
+
const environment = process.env.NODE_ENV || 'development';
|
|
14
|
+
const variables = Object.assign(Object.assign({}, (0, helpers_1.getVariables)(name, version, externals, environment)), this.options.variables);
|
|
26
15
|
if (debug) {
|
|
27
16
|
variables.DEBUG_PIRAL = debug === true ? '1.0' : debug;
|
|
28
17
|
}
|
|
29
18
|
if (emulator) {
|
|
30
19
|
variables.DEBUG_PILET = emulator === true ? '/$pilet-api' : emulator;
|
|
31
20
|
}
|
|
32
|
-
|
|
21
|
+
const plugins = [new webpack_1.DefinePlugin((0, helpers_1.getDefineVariables)(variables))];
|
|
33
22
|
(0, helpers_1.setEnvironment)(variables);
|
|
34
|
-
plugins.forEach(
|
|
35
|
-
compiler.hooks.afterEnvironment.tap(pluginName,
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
}());
|
|
23
|
+
plugins.forEach(plugin => plugin.apply(compiler));
|
|
24
|
+
compiler.hooks.afterEnvironment.tap(pluginName, () => { });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
39
27
|
exports.PiralInstanceWebpackPlugin = PiralInstanceWebpackPlugin;
|
|
40
28
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAAyD;AACzD,uCAA6E;AAE7E,MAAM,UAAU,GAAG,4BAA4B,CAAC;AAWhD,MAAa,0BAA0B;IACrC,YAAoB,OAA0C;QAA1C,YAAO,GAAP,OAAO,CAAmC;IAAG,CAAC;IAElE,KAAK,CAAC,QAAkB;QACtB,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QACnE,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;QAC1D,MAAM,SAAS,mCACV,IAAA,sBAAY,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,CAAC,GACnD,IAAI,CAAC,OAAO,CAAC,SAAS,CAC1B,CAAC;QAEF,IAAI,KAAK,EAAE;YACT,SAAS,CAAC,WAAW,GAAG,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;SACxD;QAED,IAAI,QAAQ,EAAE;YACZ,SAAS,CAAC,WAAW,GAAG,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC;SACtE;QAED,MAAM,OAAO,GAAG,CAAC,IAAI,sBAAY,CAAC,IAAA,4BAAkB,EAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAElE,IAAA,wBAAc,EAAC,SAAS,CAAC,CAAC;QAE1B,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;QAElD,QAAQ,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC5D,CAAC;CACF;AA3BD,gEA2BC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-instance-webpack-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0-beta.3607",
|
|
4
4
|
"description": "Webpack plugin for generating a valid Piral instance bundle.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -8,12 +8,26 @@
|
|
|
8
8
|
"build": "tsc",
|
|
9
9
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
10
10
|
},
|
|
11
|
+
"author": "smapiot",
|
|
12
|
+
"homepage": "https://piral.io",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=10.0"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"lib",
|
|
19
|
+
"src"
|
|
20
|
+
],
|
|
21
|
+
"funding": {
|
|
22
|
+
"type": "github",
|
|
23
|
+
"url": "https://github.com/sponsors/smapiot"
|
|
24
|
+
},
|
|
11
25
|
"repository": {
|
|
12
26
|
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/
|
|
27
|
+
"url": "git+https://github.com/smapiot/piral-cli-webpack.git"
|
|
14
28
|
},
|
|
15
|
-
"
|
|
16
|
-
"
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/smapiot/piral-cli-webpack/issues"
|
|
17
31
|
},
|
|
18
32
|
"keywords": [
|
|
19
33
|
"piral-cli",
|
|
@@ -22,14 +36,11 @@
|
|
|
22
36
|
"webpack",
|
|
23
37
|
"command"
|
|
24
38
|
],
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
"bugs": {
|
|
28
|
-
"url": "https://github.com/FlorianRappl/piral-webpack-tools/issues"
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"webpack": "4.x"
|
|
29
41
|
},
|
|
30
|
-
"homepage": "https://github.com/FlorianRappl/piral-webpack-tools#readme",
|
|
31
42
|
"devDependencies": {
|
|
32
|
-
"webpack": "4.42.0"
|
|
43
|
+
"webpack": "^4.42.0"
|
|
33
44
|
},
|
|
34
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "e21536de7be01bda680d142dcdfbe5189cf96568"
|
|
35
46
|
}
|