@metamask/snaps-cli 0.38.1-flask.1 → 1.0.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/CHANGELOG.md +377 -19
- package/README.md +67 -542
- package/dist/builders.d.ts +27 -0
- package/dist/{esm/builders.js → builders.js} +51 -48
- package/dist/builders.js.map +1 -0
- package/dist/{types/cli.d.ts → cli.d.ts} +1 -1
- package/dist/cli.js +51 -0
- package/dist/cli.js.map +1 -0
- package/dist/cmds/build/buildHandler.d.ts +13 -0
- package/dist/cmds/build/buildHandler.js +37 -0
- package/dist/cmds/build/buildHandler.js.map +1 -0
- package/dist/cmds/build/bundle.d.ts +15 -0
- package/dist/cmds/build/bundle.js +80 -0
- package/dist/cmds/build/bundle.js.map +1 -0
- package/dist/{types/commands/serve → cmds/build}/index.d.ts +4 -4
- package/dist/cmds/build/index.js +29 -0
- package/dist/cmds/build/index.js.map +1 -0
- package/dist/cmds/build/utils.d.ts +56 -0
- package/dist/cmds/build/utils.js +100 -0
- package/dist/cmds/build/utils.js.map +1 -0
- package/dist/cmds/eval/evalHandler.d.ts +9 -0
- package/dist/cmds/eval/evalHandler.js +25 -0
- package/dist/cmds/eval/evalHandler.js.map +1 -0
- package/dist/cmds/eval/index.d.ts +9 -0
- package/dist/cmds/eval/index.js +15 -0
- package/dist/cmds/eval/index.js.map +1 -0
- package/dist/cmds/index.js +14 -0
- package/dist/cmds/index.js.map +1 -0
- package/dist/cmds/init/index.d.ts +9 -0
- package/dist/cmds/init/index.js +34 -0
- package/dist/cmds/init/index.js.map +1 -0
- package/dist/cmds/init/initHandler.d.ts +26 -0
- package/dist/cmds/init/initHandler.js +69 -0
- package/dist/cmds/init/initHandler.js.map +1 -0
- package/dist/cmds/init/initUtils.d.ts +39 -0
- package/dist/cmds/init/initUtils.js +122 -0
- package/dist/cmds/init/initUtils.js.map +1 -0
- package/dist/cmds/manifest/index.d.ts +9 -0
- package/dist/cmds/manifest/index.js +24 -0
- package/dist/cmds/manifest/index.js.map +1 -0
- package/dist/cmds/manifest/manifestHandler.d.ts +10 -0
- package/dist/cmds/manifest/manifestHandler.js +50 -0
- package/dist/cmds/manifest/manifestHandler.js.map +1 -0
- package/dist/cmds/serve/index.d.ts +9 -0
- package/dist/cmds/serve/index.js +15 -0
- package/dist/cmds/serve/index.js.map +1 -0
- package/dist/cmds/serve/serveHandler.d.ts +10 -0
- package/dist/cmds/serve/serveHandler.js +59 -0
- package/dist/cmds/serve/serveHandler.js.map +1 -0
- package/dist/cmds/serve/serveUtils.d.ts +22 -0
- package/dist/cmds/serve/serveUtils.js +39 -0
- package/dist/cmds/serve/serveUtils.js.map +1 -0
- package/dist/cmds/watch/index.d.ts +9 -0
- package/dist/cmds/watch/index.js +32 -0
- package/dist/cmds/watch/index.js.map +1 -0
- package/dist/cmds/watch/watchHandler.d.ts +14 -0
- package/dist/cmds/watch/watchHandler.js +100 -0
- package/dist/cmds/watch/watchHandler.js.map +1 -0
- package/dist/main.js +15 -0
- package/dist/main.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +19 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/misc.d.ts +53 -0
- package/dist/utils/misc.js +156 -0
- package/dist/utils/misc.js.map +1 -0
- package/dist/utils/snap-config.d.ts +48 -0
- package/dist/utils/snap-config.js +117 -0
- package/dist/utils/snap-config.js.map +1 -0
- package/package.json +35 -54
- package/.browserslistrc +0 -3
- package/dist/cjs/builders.js +0 -148
- package/dist/cjs/builders.js.map +0 -1
- package/dist/cjs/cli.js +0 -35
- package/dist/cjs/cli.js.map +0 -1
- package/dist/cjs/commands/build/build.js +0 -54
- package/dist/cjs/commands/build/build.js.map +0 -1
- package/dist/cjs/commands/build/implementation.js +0 -31
- package/dist/cjs/commands/build/implementation.js.map +0 -1
- package/dist/cjs/commands/build/index.js +0 -45
- package/dist/cjs/commands/build/index.js.map +0 -1
- package/dist/cjs/commands/eval/eval.js +0 -57
- package/dist/cjs/commands/eval/eval.js.map +0 -1
- package/dist/cjs/commands/eval/implementation.js +0 -27
- package/dist/cjs/commands/eval/implementation.js.map +0 -1
- package/dist/cjs/commands/eval/index.js +0 -50
- package/dist/cjs/commands/eval/index.js.map +0 -1
- package/dist/cjs/commands/index.js +0 -30
- package/dist/cjs/commands/index.js.map +0 -1
- package/dist/cjs/commands/manifest/implementation.js +0 -34
- package/dist/cjs/commands/manifest/implementation.js.map +0 -1
- package/dist/cjs/commands/manifest/index.js +0 -50
- package/dist/cjs/commands/manifest/index.js.map +0 -1
- package/dist/cjs/commands/manifest/manifest.js +0 -55
- package/dist/cjs/commands/manifest/manifest.js.map +0 -1
- package/dist/cjs/commands/serve/index.js +0 -33
- package/dist/cjs/commands/serve/index.js.map +0 -1
- package/dist/cjs/commands/serve/serve.js +0 -21
- package/dist/cjs/commands/serve/serve.js.map +0 -1
- package/dist/cjs/commands/watch/implementation.js +0 -35
- package/dist/cjs/commands/watch/implementation.js.map +0 -1
- package/dist/cjs/commands/watch/index.js +0 -47
- package/dist/cjs/commands/watch/index.js.map +0 -1
- package/dist/cjs/commands/watch/watch.js +0 -51
- package/dist/cjs/commands/watch/watch.js.map +0 -1
- package/dist/cjs/config.js +0 -290
- package/dist/cjs/config.js.map +0 -1
- package/dist/cjs/errors.js +0 -37
- package/dist/cjs/errors.js.map +0 -1
- package/dist/cjs/index.js +0 -77
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/main.js +0 -19
- package/dist/cjs/main.js.map +0 -1
- package/dist/cjs/utils/cli.js +0 -61
- package/dist/cjs/utils/cli.js.map +0 -1
- package/dist/cjs/utils/errors.js +0 -42
- package/dist/cjs/utils/errors.js.map +0 -1
- package/dist/cjs/utils/index.js +0 -25
- package/dist/cjs/utils/index.js.map +0 -1
- package/dist/cjs/utils/legacy.js +0 -48
- package/dist/cjs/utils/legacy.js.map +0 -1
- package/dist/cjs/utils/logging.js +0 -46
- package/dist/cjs/utils/logging.js.map +0 -1
- package/dist/cjs/utils/path.js +0 -16
- package/dist/cjs/utils/path.js.map +0 -1
- package/dist/cjs/utils/steps.js +0 -52
- package/dist/cjs/utils/steps.js.map +0 -1
- package/dist/cjs/webpack/compiler.js +0 -96
- package/dist/cjs/webpack/compiler.js.map +0 -1
- package/dist/cjs/webpack/config.js +0 -234
- package/dist/cjs/webpack/config.js.map +0 -1
- package/dist/cjs/webpack/index.js +0 -22
- package/dist/cjs/webpack/index.js.map +0 -1
- package/dist/cjs/webpack/loaders/browserify.js +0 -97
- package/dist/cjs/webpack/loaders/browserify.js.map +0 -1
- package/dist/cjs/webpack/loaders/wasm.js +0 -36
- package/dist/cjs/webpack/loaders/wasm.js.map +0 -1
- package/dist/cjs/webpack/plugins.js +0 -340
- package/dist/cjs/webpack/plugins.js.map +0 -1
- package/dist/cjs/webpack/utils.js +0 -133
- package/dist/cjs/webpack/utils.js.map +0 -1
- package/dist/esm/builders.js.map +0 -1
- package/dist/esm/cli.js +0 -26
- package/dist/esm/cli.js.map +0 -1
- package/dist/esm/commands/build/build.js +0 -51
- package/dist/esm/commands/build/build.js.map +0 -1
- package/dist/esm/commands/build/implementation.js +0 -27
- package/dist/esm/commands/build/implementation.js.map +0 -1
- package/dist/esm/commands/build/index.js +0 -17
- package/dist/esm/commands/build/index.js.map +0 -1
- package/dist/esm/commands/eval/eval.js +0 -54
- package/dist/esm/commands/eval/eval.js.map +0 -1
- package/dist/esm/commands/eval/implementation.js +0 -24
- package/dist/esm/commands/eval/implementation.js.map +0 -1
- package/dist/esm/commands/eval/index.js +0 -22
- package/dist/esm/commands/eval/index.js.map +0 -1
- package/dist/esm/commands/index.js +0 -15
- package/dist/esm/commands/index.js.map +0 -1
- package/dist/esm/commands/manifest/implementation.js +0 -33
- package/dist/esm/commands/manifest/implementation.js.map +0 -1
- package/dist/esm/commands/manifest/index.js +0 -22
- package/dist/esm/commands/manifest/index.js.map +0 -1
- package/dist/esm/commands/manifest/manifest.js +0 -52
- package/dist/esm/commands/manifest/manifest.js.map +0 -1
- package/dist/esm/commands/serve/index.js +0 -18
- package/dist/esm/commands/serve/index.js.map +0 -1
- package/dist/esm/commands/serve/serve.js +0 -17
- package/dist/esm/commands/serve/serve.js.map +0 -1
- package/dist/esm/commands/watch/implementation.js +0 -34
- package/dist/esm/commands/watch/implementation.js.map +0 -1
- package/dist/esm/commands/watch/index.js +0 -19
- package/dist/esm/commands/watch/index.js.map +0 -1
- package/dist/esm/commands/watch/watch.js +0 -50
- package/dist/esm/commands/watch/watch.js.map +0 -1
- package/dist/esm/config.js +0 -294
- package/dist/esm/config.js.map +0 -1
- package/dist/esm/errors.js +0 -30
- package/dist/esm/errors.js.map +0 -1
- package/dist/esm/index.js +0 -6
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/main.js +0 -10
- package/dist/esm/main.js.map +0 -1
- package/dist/esm/utils/cli.js +0 -43
- package/dist/esm/utils/cli.js.map +0 -1
- package/dist/esm/utils/errors.js +0 -43
- package/dist/esm/utils/errors.js.map +0 -1
- package/dist/esm/utils/index.js +0 -8
- package/dist/esm/utils/index.js.map +0 -1
- package/dist/esm/utils/legacy.js +0 -47
- package/dist/esm/utils/legacy.js.map +0 -1
- package/dist/esm/utils/logging.js +0 -40
- package/dist/esm/utils/logging.js.map +0 -1
- package/dist/esm/utils/path.js +0 -13
- package/dist/esm/utils/path.js.map +0 -1
- package/dist/esm/utils/steps.js +0 -43
- package/dist/esm/utils/steps.js.map +0 -1
- package/dist/esm/webpack/compiler.js +0 -89
- package/dist/esm/webpack/compiler.js.map +0 -1
- package/dist/esm/webpack/config.js +0 -236
- package/dist/esm/webpack/config.js.map +0 -1
- package/dist/esm/webpack/index.js +0 -5
- package/dist/esm/webpack/index.js.map +0 -1
- package/dist/esm/webpack/loaders/browserify.js +0 -82
- package/dist/esm/webpack/loaders/browserify.js.map +0 -1
- package/dist/esm/webpack/loaders/wasm.js +0 -26
- package/dist/esm/webpack/loaders/wasm.js.map +0 -1
- package/dist/esm/webpack/plugins.js +0 -343
- package/dist/esm/webpack/plugins.js.map +0 -1
- package/dist/esm/webpack/utils.js +0 -160
- package/dist/esm/webpack/utils.js.map +0 -1
- package/dist/types/__fixtures__/configs/cjs.d.ts +0 -1
- package/dist/types/__fixtures__/configs/esm.d.ts +0 -3
- package/dist/types/__fixtures__/configs/invalid.d.ts +0 -3
- package/dist/types/__fixtures__/configs/javascript/snap.config.d.ts +0 -0
- package/dist/types/__fixtures__/configs/typescript/snap.config.d.ts +0 -3
- package/dist/types/builders.d.ts +0 -8
- package/dist/types/commands/build/build.d.ts +0 -10
- package/dist/types/commands/build/implementation.d.ts +0 -10
- package/dist/types/commands/build/index.d.ts +0 -10
- package/dist/types/commands/eval/__test__/browserify/bad/snap.config.d.ts +0 -3
- package/dist/types/commands/eval/__test__/browserify/good/snap.config.d.ts +0 -3
- package/dist/types/commands/eval/__test__/webpack/bad/snap.config.d.ts +0 -3
- package/dist/types/commands/eval/__test__/webpack/good/snap.config.d.ts +0 -3
- package/dist/types/commands/eval/__test__/webpack/snap.config.d.ts +0 -3
- package/dist/types/commands/eval/eval.d.ts +0 -14
- package/dist/types/commands/eval/implementation.d.ts +0 -9
- package/dist/types/commands/eval/index.d.ts +0 -10
- package/dist/types/commands/manifest/implementation.d.ts +0 -12
- package/dist/types/commands/manifest/index.d.ts +0 -10
- package/dist/types/commands/manifest/manifest.d.ts +0 -14
- package/dist/types/commands/serve/serve.d.ts +0 -16
- package/dist/types/commands/watch/implementation.d.ts +0 -14
- package/dist/types/commands/watch/index.d.ts +0 -10
- package/dist/types/commands/watch/watch.d.ts +0 -19
- package/dist/types/config.d.ts +0 -626
- package/dist/types/errors.d.ts +0 -25
- package/dist/types/index.d.ts +0 -5
- package/dist/types/utils/cli.d.ts +0 -17
- package/dist/types/utils/errors.d.ts +0 -23
- package/dist/types/utils/index.d.ts +0 -6
- package/dist/types/utils/legacy.d.ts +0 -27
- package/dist/types/utils/logging.d.ts +0 -22
- package/dist/types/utils/path.d.ts +0 -9
- package/dist/types/utils/steps.d.ts +0 -17
- package/dist/types/webpack/compiler.d.ts +0 -29
- package/dist/types/webpack/config.d.ts +0 -37
- package/dist/types/webpack/index.d.ts +0 -3
- package/dist/types/webpack/loaders/browserify.d.ts +0 -16
- package/dist/types/webpack/loaders/wasm.d.ts +0 -20
- package/dist/types/webpack/plugins.d.ts +0 -147
- package/dist/types/webpack/utils.d.ts +0 -156
- /package/dist/{types/commands → cmds}/index.d.ts +0 -0
- /package/dist/{types/main.d.ts → main.d.ts} +0 -0
package/dist/cjs/utils/index.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
_export_star(require("./cli"), exports);
|
|
6
|
-
_export_star(require("./errors"), exports);
|
|
7
|
-
_export_star(require("./legacy"), exports);
|
|
8
|
-
_export_star(require("./logging"), exports);
|
|
9
|
-
_export_star(require("./path"), exports);
|
|
10
|
-
_export_star(require("./steps"), exports);
|
|
11
|
-
function _export_star(from, to) {
|
|
12
|
-
Object.keys(from).forEach(function(k) {
|
|
13
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
14
|
-
Object.defineProperty(to, k, {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function() {
|
|
17
|
-
return from[k];
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
return from;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/index.ts"],"sourcesContent":["export * from './cli';\nexport * from './errors';\nexport * from './legacy';\nexport * from './logging';\nexport * from './path';\nexport * from './steps';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA"}
|
package/dist/cjs/utils/legacy.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
processDependencies: function() {
|
|
13
|
-
return processDependencies;
|
|
14
|
-
},
|
|
15
|
-
getDependencyRegExp: function() {
|
|
16
|
-
return getDependencyRegExp;
|
|
17
|
-
},
|
|
18
|
-
sanitizeDependencyPaths: function() {
|
|
19
|
-
return sanitizeDependencyPaths;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
const _builders = require("../builders");
|
|
23
|
-
function processDependencies(config) {
|
|
24
|
-
const { depsToTranspile, transpilationMode } = config;
|
|
25
|
-
if (transpilationMode === _builders.TranspilationModes.LocalAndDeps) {
|
|
26
|
-
const regex = getDependencyRegExp(depsToTranspile);
|
|
27
|
-
if (regex !== null) {
|
|
28
|
-
return [
|
|
29
|
-
regex
|
|
30
|
-
];
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return [];
|
|
34
|
-
}
|
|
35
|
-
function getDependencyRegExp(dependencies) {
|
|
36
|
-
if (!dependencies || dependencies.includes('.') || !dependencies.length) {
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
const paths = sanitizeDependencyPaths(dependencies);
|
|
40
|
-
return RegExp(`/node_modules/(?!${paths.join('|')})`, 'u');
|
|
41
|
-
}
|
|
42
|
-
function sanitizeDependencyPaths(dependencies) {
|
|
43
|
-
return dependencies.map((dependency)=>{
|
|
44
|
-
return dependency.replace(/^[/\\]+/u, '').replace(/[/\\]+$/u, '');
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
//# sourceMappingURL=legacy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/legacy.ts"],"sourcesContent":["import { TranspilationModes } from '../builders';\nimport type { LegacyOptions } from '../config';\n\n/**\n * Get the dependencies to transpile, as well as the regular input file.\n *\n * If `transpilationMode` is not set to `localAndDeps`, this will return an\n * empty array.\n *\n * @param config - The config object.\n * @returns An array with regular expressions of dependencies that should be\n * transpiled.\n */\nexport function processDependencies(config: LegacyOptions) {\n const { depsToTranspile, transpilationMode } = config;\n if (transpilationMode === TranspilationModes.LocalAndDeps) {\n const regex = getDependencyRegExp(depsToTranspile);\n if (regex !== null) {\n return [regex];\n }\n }\n\n return [];\n}\n\n/**\n * Processes a string of space delimited dependencies into one RegExp string.\n *\n * @param dependencies - An array of dependencies to add to the RegExp.\n * @returns A RegExp object.\n */\nexport function getDependencyRegExp(dependencies: string[]): RegExp | null {\n if (!dependencies || dependencies.includes('.') || !dependencies.length) {\n return null;\n }\n\n const paths: string[] = sanitizeDependencyPaths(dependencies);\n return RegExp(`/node_modules/(?!${paths.join('|')})`, 'u');\n}\n\n/**\n * Helper function to remove any leading and trailing slashes from dependency\n * list.\n *\n * @param dependencies - An array of dependencies to sanitize.\n * @returns An array of sanitized paths.\n */\nexport function sanitizeDependencyPaths(dependencies: string[]): string[] {\n return dependencies.map((dependency) => {\n return dependency.replace(/^[/\\\\]+/u, '').replace(/[/\\\\]+$/u, '');\n });\n}\n"],"names":["processDependencies","getDependencyRegExp","sanitizeDependencyPaths","config","depsToTranspile","transpilationMode","TranspilationModes","LocalAndDeps","regex","dependencies","includes","length","paths","RegExp","join","map","dependency","replace"],"mappings":";;;;;;;;;;;IAagBA,mBAAmB;eAAnBA;;IAkBAC,mBAAmB;eAAnBA;;IAgBAC,uBAAuB;eAAvBA;;;0BA/CmB;AAa5B,SAASF,oBAAoBG,MAAqB;IACvD,MAAM,EAAEC,eAAe,EAAEC,iBAAiB,EAAE,GAAGF;IAC/C,IAAIE,sBAAsBC,4BAAkB,CAACC,YAAY,EAAE;QACzD,MAAMC,QAAQP,oBAAoBG;QAClC,IAAII,UAAU,MAAM;YAClB,OAAO;gBAACA;aAAM;QAChB;IACF;IAEA,OAAO,EAAE;AACX;AAQO,SAASP,oBAAoBQ,YAAsB;IACxD,IAAI,CAACA,gBAAgBA,aAAaC,QAAQ,CAAC,QAAQ,CAACD,aAAaE,MAAM,EAAE;QACvE,OAAO;IACT;IAEA,MAAMC,QAAkBV,wBAAwBO;IAChD,OAAOI,OAAO,CAAC,iBAAiB,EAAED,MAAME,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;AACxD;AASO,SAASZ,wBAAwBO,YAAsB;IAC5D,OAAOA,aAAaM,GAAG,CAAC,CAACC;QACvB,OAAOA,WAAWC,OAAO,CAAC,YAAY,IAAIA,OAAO,CAAC,YAAY;IAChE;AACF"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
warn: function() {
|
|
13
|
-
return warn;
|
|
14
|
-
},
|
|
15
|
-
info: function() {
|
|
16
|
-
return info;
|
|
17
|
-
},
|
|
18
|
-
error: function() {
|
|
19
|
-
return error;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
const _snapsutils = require("@metamask/snaps-utils");
|
|
23
|
-
const _chalk = require("chalk");
|
|
24
|
-
function warn(message, spinner) {
|
|
25
|
-
if (spinner) {
|
|
26
|
-
spinner.clear();
|
|
27
|
-
spinner.frame();
|
|
28
|
-
}
|
|
29
|
-
(0, _snapsutils.logWarning)(`${(0, _chalk.yellow)('⚠')} ${message}`);
|
|
30
|
-
}
|
|
31
|
-
function info(message, spinner) {
|
|
32
|
-
if (spinner) {
|
|
33
|
-
spinner.clear();
|
|
34
|
-
spinner.frame();
|
|
35
|
-
}
|
|
36
|
-
(0, _snapsutils.logInfo)(`${(0, _chalk.blue)('ℹ')} ${(0, _chalk.dim)(message)}`);
|
|
37
|
-
}
|
|
38
|
-
function error(message, spinner) {
|
|
39
|
-
if (spinner) {
|
|
40
|
-
spinner.clear();
|
|
41
|
-
spinner.frame();
|
|
42
|
-
}
|
|
43
|
-
(0, _snapsutils.logError)(`${(0, _chalk.red)('✖')} ${message}`);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
//# sourceMappingURL=logging.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/logging.ts"],"sourcesContent":["import { logError, logInfo, logWarning } from '@metamask/snaps-utils';\nimport { blue, dim, red, yellow } from 'chalk';\nimport type { Ora } from 'ora';\n\n/**\n * Log a warning message. The message is prefixed with \"Warning:\".\n *\n * @param message - The message to log.\n * @param spinner - The spinner to clear.\n */\nexport function warn(message: string, spinner?: Ora) {\n if (spinner) {\n spinner.clear();\n spinner.frame();\n }\n\n logWarning(`${yellow('⚠')} ${message}`);\n}\n\n/**\n * Log an info message.\n *\n * @param message - The message to log.\n * @param spinner - The spinner to clear.\n */\nexport function info(message: string, spinner?: Ora) {\n if (spinner) {\n spinner.clear();\n spinner.frame();\n }\n\n logInfo(`${blue('ℹ')} ${dim(message)}`);\n}\n\n/**\n * Log an error message. The message is prefixed with \"Error:\".\n *\n * @param message - The message to log.\n * @param spinner - The spinner to clear.\n */\nexport function error(message: string, spinner?: Ora) {\n if (spinner) {\n spinner.clear();\n spinner.frame();\n }\n\n logError(`${red('✖')} ${message}`);\n}\n"],"names":["warn","info","error","message","spinner","clear","frame","logWarning","yellow","logInfo","blue","dim","logError","red"],"mappings":";;;;;;;;;;;IAUgBA,IAAI;eAAJA;;IAeAC,IAAI;eAAJA;;IAeAC,KAAK;eAALA;;;4BAxC8B;uBACP;AAShC,SAASF,KAAKG,OAAe,EAAEC,OAAa;IACjD,IAAIA,SAAS;QACXA,QAAQC,KAAK;QACbD,QAAQE,KAAK;IACf;IAEAC,IAAAA,sBAAU,EAAC,CAAC,EAAEC,IAAAA,aAAM,EAAC,KAAK,CAAC,EAAEL,QAAQ,CAAC;AACxC;AAQO,SAASF,KAAKE,OAAe,EAAEC,OAAa;IACjD,IAAIA,SAAS;QACXA,QAAQC,KAAK;QACbD,QAAQE,KAAK;IACf;IAEAG,IAAAA,mBAAO,EAAC,CAAC,EAAEC,IAAAA,WAAI,EAAC,KAAK,CAAC,EAAEC,IAAAA,UAAG,EAACR,SAAS,CAAC;AACxC;AAQO,SAASD,MAAMC,OAAe,EAAEC,OAAa;IAClD,IAAIA,SAAS;QACXA,QAAQC,KAAK;QACbD,QAAQE,KAAK;IACf;IAEAM,IAAAA,oBAAQ,EAAC,CAAC,EAAEC,IAAAA,UAAG,EAAC,KAAK,CAAC,EAAEV,QAAQ,CAAC;AACnC"}
|
package/dist/cjs/utils/path.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "getRelativePath", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return getRelativePath;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _path = require("path");
|
|
12
|
-
function getRelativePath(absolutePath, cwd = process.cwd()) {
|
|
13
|
-
return (0, _path.relative)(cwd, absolutePath);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=path.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/path.ts"],"sourcesContent":["import { relative } from 'path';\n\n/**\n * Get the relative path from the current working directory to the given\n * absolute path.\n *\n * @param absolutePath - The absolute path.\n * @param cwd - The current working directory. Defaults to `process.cwd()`.\n * @returns The relative path.\n */\nexport function getRelativePath(absolutePath: string, cwd = process.cwd()) {\n return relative(cwd, absolutePath);\n}\n"],"names":["getRelativePath","absolutePath","cwd","process","relative"],"mappings":";;;;+BAUgBA;;;eAAAA;;;sBAVS;AAUlB,SAASA,gBAAgBC,YAAoB,EAAEC,MAAMC,QAAQD,GAAG,EAAE;IACvE,OAAOE,IAAAA,cAAQ,EAACF,KAAKD;AACvB"}
|
package/dist/cjs/utils/steps.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "executeSteps", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return executeSteps;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _chalk = require("chalk");
|
|
12
|
-
const _ora = /*#__PURE__*/ _interop_require_default(require("ora"));
|
|
13
|
-
const _errors = require("./errors");
|
|
14
|
-
const _logging = require("./logging");
|
|
15
|
-
function _interop_require_default(obj) {
|
|
16
|
-
return obj && obj.__esModule ? obj : {
|
|
17
|
-
default: obj
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
async function executeSteps(steps, context) {
|
|
21
|
-
const spinner = (0, _ora.default)({
|
|
22
|
-
// Ora writes to `process.stderr` by default.
|
|
23
|
-
stream: process.stdout
|
|
24
|
-
});
|
|
25
|
-
spinner.start();
|
|
26
|
-
try {
|
|
27
|
-
for (const step of steps){
|
|
28
|
-
// If the step has a condition, and it returns false, we skip the step.
|
|
29
|
-
if (step.condition && !step.condition(context)) {
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
// Calling `start` here instead of setting `spinner.text` seems to work
|
|
33
|
-
// better when the process doesn't have a TTY.
|
|
34
|
-
spinner.start((0, _chalk.dim)(step.name));
|
|
35
|
-
await step.task({
|
|
36
|
-
...context,
|
|
37
|
-
spinner
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
// The spinner may have been stopped by a step, so we only succeed if it's
|
|
41
|
-
// still spinning.
|
|
42
|
-
if (spinner.isSpinning) {
|
|
43
|
-
spinner.succeed('Done!');
|
|
44
|
-
}
|
|
45
|
-
} catch (_error) {
|
|
46
|
-
(0, _logging.error)((0, _errors.getErrorMessage)(_error), spinner);
|
|
47
|
-
spinner.stop();
|
|
48
|
-
process.exitCode = 1;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
//# sourceMappingURL=steps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/steps.ts"],"sourcesContent":["import { dim } from 'chalk';\nimport type { Ora } from 'ora';\nimport createSpinner from 'ora';\n\nimport { getErrorMessage } from './errors';\nimport { error } from './logging';\n\nexport type Step<Context extends Record<string, unknown>> = {\n name: string;\n condition?: (context: Context) => boolean;\n task: (context: Context & { spinner: Ora }) => Promise<void>;\n};\n\nexport type Steps<Context extends Record<string, unknown>> = Readonly<\n Step<Context>[]\n>;\n\n/**\n * Execute a list of steps in series. Each step receives the context object and\n * a spinner instance.\n *\n * @param steps - The steps to execute.\n * @param context - The context object that will be passed to each step.\n */\nexport async function executeSteps<Context extends Record<string, unknown>>(\n steps: Steps<Context>,\n context: Context,\n) {\n const spinner = createSpinner({\n // Ora writes to `process.stderr` by default.\n stream: process.stdout,\n });\n\n spinner.start();\n\n try {\n for (const step of steps) {\n // If the step has a condition, and it returns false, we skip the step.\n if (step.condition && !step.condition(context)) {\n continue;\n }\n\n // Calling `start` here instead of setting `spinner.text` seems to work\n // better when the process doesn't have a TTY.\n spinner.start(dim(step.name));\n\n await step.task({\n ...context,\n spinner,\n });\n }\n\n // The spinner may have been stopped by a step, so we only succeed if it's\n // still spinning.\n if (spinner.isSpinning) {\n spinner.succeed('Done!');\n }\n } catch (_error) {\n error(getErrorMessage(_error), spinner);\n spinner.stop();\n process.exitCode = 1;\n }\n}\n"],"names":["executeSteps","steps","context","spinner","createSpinner","stream","process","stdout","start","step","condition","dim","name","task","isSpinning","succeed","_error","error","getErrorMessage","stop","exitCode"],"mappings":";;;;+BAwBsBA;;;eAAAA;;;uBAxBF;4DAEM;wBAEM;yBACV;;;;;;AAmBf,eAAeA,aACpBC,KAAqB,EACrBC,OAAgB;IAEhB,MAAMC,UAAUC,IAAAA,YAAa,EAAC;QAC5B,6CAA6C;QAC7CC,QAAQC,QAAQC,MAAM;IACxB;IAEAJ,QAAQK,KAAK;IAEb,IAAI;QACF,KAAK,MAAMC,QAAQR,MAAO;YACxB,uEAAuE;YACvE,IAAIQ,KAAKC,SAAS,IAAI,CAACD,KAAKC,SAAS,CAACR,UAAU;gBAC9C;YACF;YAEA,uEAAuE;YACvE,8CAA8C;YAC9CC,QAAQK,KAAK,CAACG,IAAAA,UAAG,EAACF,KAAKG,IAAI;YAE3B,MAAMH,KAAKI,IAAI,CAAC;gBACd,GAAGX,OAAO;gBACVC;YACF;QACF;QAEA,0EAA0E;QAC1E,kBAAkB;QAClB,IAAIA,QAAQW,UAAU,EAAE;YACtBX,QAAQY,OAAO,CAAC;QAClB;IACF,EAAE,OAAOC,QAAQ;QACfC,IAAAA,cAAK,EAACC,IAAAA,uBAAe,EAACF,SAASb;QAC/BA,QAAQgB,IAAI;QACZb,QAAQc,QAAQ,GAAG;IACrB;AACF"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
getCompiler: function() {
|
|
13
|
-
return getCompiler;
|
|
14
|
-
},
|
|
15
|
-
getServer: function() {
|
|
16
|
-
return getServer;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _http = require("http");
|
|
20
|
-
const _servehandler = /*#__PURE__*/ _interop_require_default(require("serve-handler"));
|
|
21
|
-
const _webpack = require("webpack");
|
|
22
|
-
const _config = require("./config");
|
|
23
|
-
function _interop_require_default(obj) {
|
|
24
|
-
return obj && obj.__esModule ? obj : {
|
|
25
|
-
default: obj
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
async function getCompiler(config, options) {
|
|
29
|
-
const baseWebpackConfig = await (0, _config.getDefaultConfiguration)(config, options);
|
|
30
|
-
const webpackConfig = config.customizeWebpackConfig?.(baseWebpackConfig) ?? baseWebpackConfig;
|
|
31
|
-
return (0, _webpack.webpack)(webpackConfig);
|
|
32
|
-
}
|
|
33
|
-
function getServer(config) {
|
|
34
|
-
const server = (0, _http.createServer)((request, response)=>{
|
|
35
|
-
(0, _servehandler.default)(request, response, {
|
|
36
|
-
public: config.server.root,
|
|
37
|
-
headers: [
|
|
38
|
-
{
|
|
39
|
-
source: '**/*',
|
|
40
|
-
headers: [
|
|
41
|
-
{
|
|
42
|
-
key: 'Cache-Control',
|
|
43
|
-
value: 'no-cache'
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
key: 'Access-Control-Allow-Origin',
|
|
47
|
-
value: '*'
|
|
48
|
-
}
|
|
49
|
-
]
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
})?.catch(/* istanbul ignore next */ ()=>{
|
|
53
|
-
response.statusCode = 500;
|
|
54
|
-
response.end();
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
/**
|
|
58
|
-
* Start the server on the port specified in the config.
|
|
59
|
-
*
|
|
60
|
-
* @param port - The port to listen on.
|
|
61
|
-
* @returns A promise that resolves when the server is listening. The promise
|
|
62
|
-
* resolves to an object with the port and the server instance. Note that if
|
|
63
|
-
* the `config.server.port` is `0`, the OS will choose a random port for us,
|
|
64
|
-
* so we need to get the port from the server after it starts.
|
|
65
|
-
*/ const listen = async (port = config.server.port)=>{
|
|
66
|
-
return new Promise((resolve, reject)=>{
|
|
67
|
-
try {
|
|
68
|
-
server.listen(port, ()=>{
|
|
69
|
-
const close = async ()=>{
|
|
70
|
-
await new Promise((resolveClose, rejectClose)=>{
|
|
71
|
-
server.close((closeError)=>{
|
|
72
|
-
if (closeError) {
|
|
73
|
-
return rejectClose(closeError);
|
|
74
|
-
}
|
|
75
|
-
return resolveClose();
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
const address = server.address();
|
|
80
|
-
resolve({
|
|
81
|
-
port: address.port,
|
|
82
|
-
server,
|
|
83
|
-
close
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
} catch (listenError) {
|
|
87
|
-
reject(listenError);
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
return {
|
|
92
|
-
listen
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
//# sourceMappingURL=compiler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/webpack/compiler.ts"],"sourcesContent":["import type { Server } from 'http';\nimport { createServer } from 'http';\nimport type { AddressInfo } from 'net';\nimport serveMiddleware from 'serve-handler';\nimport { webpack } from 'webpack';\n\nimport type { ProcessedConfig, ProcessedWebpackConfig } from '../config';\nimport type { WebpackOptions } from './config';\nimport { getDefaultConfiguration } from './config';\n\n/**\n * Get a Webpack compiler for the given config.\n *\n * @param config - The config object.\n * @param options - The Webpack options.\n * @returns The Webpack compiler.\n */\nexport async function getCompiler(\n config: ProcessedWebpackConfig,\n options?: WebpackOptions,\n) {\n const baseWebpackConfig = await getDefaultConfiguration(config, options);\n const webpackConfig =\n config.customizeWebpackConfig?.(baseWebpackConfig) ?? baseWebpackConfig;\n\n return webpack(webpackConfig);\n}\n\n/**\n * Get a static server for development purposes.\n *\n * Note: We're intentionally not using `webpack-dev-server` here because it\n * adds a lot of extra stuff to the output that we don't need, and it's\n * difficult to customize.\n *\n * @param config - The config object.\n * @returns An object with a `listen` method that returns a promise that\n * resolves when the server is listening.\n */\nexport function getServer(config: ProcessedConfig) {\n const server = createServer((request, response) => {\n serveMiddleware(request, response, {\n public: config.server.root,\n headers: [\n {\n source: '**/*',\n headers: [\n {\n key: 'Cache-Control',\n value: 'no-cache',\n },\n {\n key: 'Access-Control-Allow-Origin',\n value: '*',\n },\n ],\n },\n ],\n })?.catch(\n /* istanbul ignore next */ () => {\n response.statusCode = 500;\n response.end();\n },\n );\n });\n\n /**\n * Start the server on the port specified in the config.\n *\n * @param port - The port to listen on.\n * @returns A promise that resolves when the server is listening. The promise\n * resolves to an object with the port and the server instance. Note that if\n * the `config.server.port` is `0`, the OS will choose a random port for us,\n * so we need to get the port from the server after it starts.\n */\n const listen = async (port = config.server.port) => {\n return new Promise<{\n port: number;\n server: Server;\n close: () => Promise<void>;\n }>((resolve, reject) => {\n try {\n server.listen(port, () => {\n const close = async () => {\n await new Promise<void>((resolveClose, rejectClose) => {\n server.close((closeError) => {\n if (closeError) {\n return rejectClose(closeError);\n }\n\n return resolveClose();\n });\n });\n };\n\n const address = server.address() as AddressInfo;\n resolve({ port: address.port, server, close });\n });\n } catch (listenError) {\n reject(listenError);\n }\n });\n };\n\n return { listen };\n}\n"],"names":["getCompiler","getServer","config","options","baseWebpackConfig","getDefaultConfiguration","webpackConfig","customizeWebpackConfig","webpack","server","createServer","request","response","serveMiddleware","public","root","headers","source","key","value","catch","statusCode","end","listen","port","Promise","resolve","reject","close","resolveClose","rejectClose","closeError","address","listenError"],"mappings":";;;;;;;;;;;IAiBsBA,WAAW;eAAXA;;IAsBNC,SAAS;eAATA;;;sBAtCa;qEAED;yBACJ;wBAIgB;;;;;;AASjC,eAAeD,YACpBE,MAA8B,EAC9BC,OAAwB;IAExB,MAAMC,oBAAoB,MAAMC,IAAAA,+BAAuB,EAACH,QAAQC;IAChE,MAAMG,gBACJJ,OAAOK,sBAAsB,GAAGH,sBAAsBA;IAExD,OAAOI,IAAAA,gBAAO,EAACF;AACjB;AAaO,SAASL,UAAUC,MAAuB;IAC/C,MAAMO,SAASC,IAAAA,kBAAY,EAAC,CAACC,SAASC;QACpCC,IAAAA,qBAAe,EAACF,SAASC,UAAU;YACjCE,QAAQZ,OAAOO,MAAM,CAACM,IAAI;YAC1BC,SAAS;gBACP;oBACEC,QAAQ;oBACRD,SAAS;wBACP;4BACEE,KAAK;4BACLC,OAAO;wBACT;wBACA;4BACED,KAAK;4BACLC,OAAO;wBACT;qBACD;gBACH;aACD;QACH,IAAIC,MACF,wBAAwB,GAAG;YACzBR,SAASS,UAAU,GAAG;YACtBT,SAASU,GAAG;QACd;IAEJ;IAEA;;;;;;;;GAQC,GACD,MAAMC,SAAS,OAAOC,OAAOtB,OAAOO,MAAM,CAACe,IAAI;QAC7C,OAAO,IAAIC,QAIR,CAACC,SAASC;YACX,IAAI;gBACFlB,OAAOc,MAAM,CAACC,MAAM;oBAClB,MAAMI,QAAQ;wBACZ,MAAM,IAAIH,QAAc,CAACI,cAAcC;4BACrCrB,OAAOmB,KAAK,CAAC,CAACG;gCACZ,IAAIA,YAAY;oCACd,OAAOD,YAAYC;gCACrB;gCAEA,OAAOF;4BACT;wBACF;oBACF;oBAEA,MAAMG,UAAUvB,OAAOuB,OAAO;oBAC9BN,QAAQ;wBAAEF,MAAMQ,QAAQR,IAAI;wBAAEf;wBAAQmB;oBAAM;gBAC9C;YACF,EAAE,OAAOK,aAAa;gBACpBN,OAAOM;YACT;QACF;IACF;IAEA,OAAO;QAAEV;IAAO;AAClB"}
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "getDefaultConfiguration", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return getDefaultConfiguration;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _snapswebpackplugin = /*#__PURE__*/ _interop_require_default(require("@metamask/snaps-webpack-plugin"));
|
|
12
|
-
const _module = require("module");
|
|
13
|
-
const _path = require("path");
|
|
14
|
-
const _terserwebpackplugin = /*#__PURE__*/ _interop_require_default(require("terser-webpack-plugin"));
|
|
15
|
-
const _webpack = require("webpack");
|
|
16
|
-
const _plugins = require("./plugins");
|
|
17
|
-
const _utils = require("./utils");
|
|
18
|
-
function _interop_require_default(obj) {
|
|
19
|
-
return obj && obj.__esModule ? obj : {
|
|
20
|
-
default: obj
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
async function getDefaultConfiguration(config, options = {
|
|
24
|
-
evaluate: config.evaluate
|
|
25
|
-
}) {
|
|
26
|
-
const spinnerText = options.spinner?.text;
|
|
27
|
-
const builtInResolver = config.stats.builtIns && new _plugins.SnapsBuiltInResolver(config.stats.builtIns, options.spinner);
|
|
28
|
-
return {
|
|
29
|
-
/**
|
|
30
|
-
* The target is set to `browserslist` so that Webpack will compile the
|
|
31
|
-
* bundle to support the browsers specified in the `.browserslistrc` file.
|
|
32
|
-
* This Browserslist file contains the browsers that are supported by
|
|
33
|
-
* MetaMask Snaps.
|
|
34
|
-
*
|
|
35
|
-
* @see https://webpack.js.org/configuration/target/
|
|
36
|
-
*/ target: `browserslist:${_utils.BROWSERSLIST_FILE}`,
|
|
37
|
-
/**
|
|
38
|
-
* The mode is set to `production` by default, so that Webpack will minify
|
|
39
|
-
* and optimize the bundle.
|
|
40
|
-
*
|
|
41
|
-
* @see https://webpack.js.org/configuration/mode/
|
|
42
|
-
*/ mode: 'production',
|
|
43
|
-
/**
|
|
44
|
-
* The entry point is set to the `input` value from the config object.
|
|
45
|
-
*
|
|
46
|
-
* @see https://webpack.js.org/configuration/entry-context/
|
|
47
|
-
*/ entry: config.input,
|
|
48
|
-
/**
|
|
49
|
-
* The devtool option controls how source maps are generated. We set it to
|
|
50
|
-
* the `sourceMap` value from the config object.
|
|
51
|
-
*
|
|
52
|
-
* @see https://webpack.js.org/configuration/devtool/
|
|
53
|
-
*/ devtool: (0, _utils.getDevTool)(config.sourceMap),
|
|
54
|
-
/**
|
|
55
|
-
* The stats option controls how much information is printed to the console
|
|
56
|
-
* when Webpack is running. We set it to `none` so that we can control the
|
|
57
|
-
* output ourselves.
|
|
58
|
-
*
|
|
59
|
-
* @see https://webpack.js.org/configuration/stats/
|
|
60
|
-
*/ stats: 'none',
|
|
61
|
-
/**
|
|
62
|
-
* The output options.
|
|
63
|
-
*
|
|
64
|
-
* @see https://webpack.js.org/configuration/output/
|
|
65
|
-
*/ output: {
|
|
66
|
-
/**
|
|
67
|
-
* This indicates whether Webpack should clear the output directory
|
|
68
|
-
* before building. We set it to the `clean` value from the config
|
|
69
|
-
* object.
|
|
70
|
-
*
|
|
71
|
-
* @see https://webpack.js.org/configuration/output/#outputclean
|
|
72
|
-
*/ clean: config.output.clean,
|
|
73
|
-
/**
|
|
74
|
-
* The filename of the bundle. We set it to the `filename` value from
|
|
75
|
-
* the config object.
|
|
76
|
-
*
|
|
77
|
-
* @see https://webpack.js.org/configuration/output/#outputfilename
|
|
78
|
-
*/ filename: config.output.filename,
|
|
79
|
-
/**
|
|
80
|
-
* The path to the output directory. We set it to the `path` value from
|
|
81
|
-
* the config object.
|
|
82
|
-
*
|
|
83
|
-
* @see https://webpack.js.org/configuration/output/#outputpath
|
|
84
|
-
*/ path: config.output.path,
|
|
85
|
-
/**
|
|
86
|
-
* The public path of the bundle. We set it to `/` by default, so that
|
|
87
|
-
* the bundle can be loaded from the root of the server.
|
|
88
|
-
*
|
|
89
|
-
* @see https://webpack.js.org/configuration/output/#outputpublicpath
|
|
90
|
-
*/ publicPath: '/',
|
|
91
|
-
/**
|
|
92
|
-
* The library configuration. This tells Webpack how to export the
|
|
93
|
-
* bundle.
|
|
94
|
-
*
|
|
95
|
-
* @see https://webpack.js.org/configuration/output/#outputlibrary
|
|
96
|
-
*/ library: {
|
|
97
|
-
/**
|
|
98
|
-
* This tells Webpack to export the bundle as a CommonJS module. This
|
|
99
|
-
* is necessary for MetaMask Snaps.
|
|
100
|
-
*
|
|
101
|
-
* @see https://webpack.js.org/configuration/output/#outputlibrarytarget
|
|
102
|
-
*/ type: 'commonjs'
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
/**
|
|
106
|
-
* The module configuration. This is where we tell Webpack how to handle
|
|
107
|
-
* different types of files.
|
|
108
|
-
*
|
|
109
|
-
* @see https://webpack.js.org/configuration/module/
|
|
110
|
-
*/ module: {
|
|
111
|
-
rules: [
|
|
112
|
-
{
|
|
113
|
-
test: /\.[tj]sx?$/u,
|
|
114
|
-
exclude: /node_modules/u,
|
|
115
|
-
use: await (0, _utils.getDefaultLoader)(config)
|
|
116
|
-
},
|
|
117
|
-
config.experimental.wasm && {
|
|
118
|
-
test: /\.wasm$/u,
|
|
119
|
-
use: {
|
|
120
|
-
loader: (0, _path.resolve)(__dirname, 'loaders', 'wasm')
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
]
|
|
124
|
-
},
|
|
125
|
-
/**
|
|
126
|
-
* The resolve configuration. This tells Webpack how to resolve imports.
|
|
127
|
-
* We set it to resolve `.js` and `.ts` files.
|
|
128
|
-
*
|
|
129
|
-
* @see https://webpack.js.org/configuration/resolve/
|
|
130
|
-
*/ resolve: {
|
|
131
|
-
/**
|
|
132
|
-
* The extensions to resolve. We set it to resolve `.js` and `.ts`
|
|
133
|
-
* files.
|
|
134
|
-
*/ extensions: [
|
|
135
|
-
'.js',
|
|
136
|
-
'.ts'
|
|
137
|
-
],
|
|
138
|
-
/**
|
|
139
|
-
* The fallback options. This tells Webpack how to handle imports that
|
|
140
|
-
* aren't resolved. By default, we set Node.js built-ins to `false`, so
|
|
141
|
-
* that they are ignored.
|
|
142
|
-
*/ fallback: Object.fromEntries(_module.builtinModules.map((name)=>[
|
|
143
|
-
name,
|
|
144
|
-
false
|
|
145
|
-
])),
|
|
146
|
-
/**
|
|
147
|
-
* The plugins to use. We use the {@link SnapsBuiltInResolver} to show
|
|
148
|
-
* warnings about using Node.js built-ins, when no fallback is specified.
|
|
149
|
-
*/ plugins: [
|
|
150
|
-
builtInResolver
|
|
151
|
-
]
|
|
152
|
-
},
|
|
153
|
-
/**
|
|
154
|
-
* The plugins to use.
|
|
155
|
-
*
|
|
156
|
-
* @see https://webpack.js.org/configuration/plugins/
|
|
157
|
-
*/ plugins: [
|
|
158
|
-
/**
|
|
159
|
-
* The `SnapsWebpackPlugin` is a Webpack plugin that checks and updates
|
|
160
|
-
* the manifest file, and evaluates the bundle in SES. While not strictly
|
|
161
|
-
* required, it's highly recommended to use this plugin.
|
|
162
|
-
*/ new _snapswebpackplugin.default({
|
|
163
|
-
manifestPath: config.manifest.path,
|
|
164
|
-
writeManifest: config.manifest.update,
|
|
165
|
-
eval: !options.watch && options.evaluate
|
|
166
|
-
}),
|
|
167
|
-
/**
|
|
168
|
-
* The `SnapsStatsPlugin` is a Webpack plugin that handles the stats
|
|
169
|
-
* output. It's used to show the stats in the terminal, in a format that
|
|
170
|
-
* is easy to read.
|
|
171
|
-
*/ new _plugins.SnapsStatsPlugin({
|
|
172
|
-
verbose: config.stats.verbose
|
|
173
|
-
}, options.spinner),
|
|
174
|
-
/**
|
|
175
|
-
* The `EnvironmentPlugin` is a Webpack plugin that adds environment
|
|
176
|
-
* variables to the bundle. We use it to add the `NODE_ENV` and `DEBUG`
|
|
177
|
-
* environment variables.
|
|
178
|
-
*/ new _webpack.EnvironmentPlugin(config.environment),
|
|
179
|
-
/**
|
|
180
|
-
* The `ProgressPlugin` is a Webpack plugin that logs the progress of
|
|
181
|
-
* the build. We set it to log the progress to the spinner.
|
|
182
|
-
*/ new _webpack.ProgressPlugin({
|
|
183
|
-
handler: (0, _utils.getProgressHandler)(options.spinner, spinnerText)
|
|
184
|
-
}),
|
|
185
|
-
/**
|
|
186
|
-
* The `SnapsBundleWarningPlugin` is a Webpack plugin that shows a
|
|
187
|
-
* warning when the bundle is potentially incompatible with MetaMask
|
|
188
|
-
* Snaps.
|
|
189
|
-
*/ new _plugins.SnapsBundleWarningsPlugin({
|
|
190
|
-
builtInResolver,
|
|
191
|
-
builtIns: Boolean(config.stats.builtIns),
|
|
192
|
-
buffer: config.stats.buffer
|
|
193
|
-
}, options.spinner),
|
|
194
|
-
/**
|
|
195
|
-
* The `WatchPlugin` is a Webpack plugin that adds extra files to watch
|
|
196
|
-
* for changes. This is useful for rebuilding the bundle when the
|
|
197
|
-
* manifest file changes.
|
|
198
|
-
*/ options.watch && new _plugins.SnapsWatchPlugin({
|
|
199
|
-
bundle: (0, _path.resolve)(config.output.path, config.output.filename),
|
|
200
|
-
evaluate: options.evaluate,
|
|
201
|
-
files: [
|
|
202
|
-
config.manifest.path
|
|
203
|
-
]
|
|
204
|
-
}, options.spinner)
|
|
205
|
-
].filter(Boolean),
|
|
206
|
-
/**
|
|
207
|
-
* The optimization configuration. This tells Webpack how to optimize the
|
|
208
|
-
* bundle. Most of the time, you won't need to change this, as the default
|
|
209
|
-
* options set by the `mode` option are sufficient.
|
|
210
|
-
*/ optimization: {
|
|
211
|
-
minimize: config.output.minimize,
|
|
212
|
-
/**
|
|
213
|
-
* The minimizer to use. We set it to use the `TerserPlugin`.
|
|
214
|
-
*/ minimizer: [
|
|
215
|
-
new _terserwebpackplugin.default({
|
|
216
|
-
parallel: true
|
|
217
|
-
})
|
|
218
|
-
]
|
|
219
|
-
},
|
|
220
|
-
/**
|
|
221
|
-
* The infrastructure logging configuration. This tells Webpack how to
|
|
222
|
-
* log messages.
|
|
223
|
-
*
|
|
224
|
-
* @see https://webpack.js.org/configuration/infrastructure-logging
|
|
225
|
-
*/ infrastructureLogging: {
|
|
226
|
-
/**
|
|
227
|
-
* The level of logging to use. We set it to `none`, so that we can
|
|
228
|
-
* control the output ourselves.
|
|
229
|
-
*/ level: 'none'
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/webpack/config.ts"],"sourcesContent":["import SnapsWebpackPlugin from '@metamask/snaps-webpack-plugin';\nimport { builtinModules } from 'module';\nimport type { Ora } from 'ora';\nimport { resolve } from 'path';\nimport TerserPlugin from 'terser-webpack-plugin';\nimport type { Configuration } from 'webpack';\nimport { EnvironmentPlugin, ProgressPlugin } from 'webpack';\n\nimport type { ProcessedWebpackConfig } from '../config';\nimport {\n SnapsBuiltInResolver,\n SnapsBundleWarningsPlugin,\n SnapsStatsPlugin,\n SnapsWatchPlugin,\n} from './plugins';\nimport {\n BROWSERSLIST_FILE,\n getDefaultLoader,\n getDevTool,\n getProgressHandler,\n} from './utils';\n\nexport type WebpackOptions = {\n /**\n * Whether to watch for changes.\n */\n watch?: boolean;\n\n /**\n * Whether to evaluate the bundle. If this is set, it will override the\n * `evaluate` option in the config object.\n */\n evaluate?: boolean;\n\n /**\n * The spinner to use for logging.\n */\n spinner?: Ora;\n};\n\n/**\n * Get the default Webpack configuration. This is the configuration that will\n * be used if the user doesn't provide a custom Webpack configuration. The\n * configuration is based on the snap config.\n *\n * The default configuration includes:\n *\n * - `SWC` to transpile TypeScript and JavaScript files.\n * - `TerserPlugin` to minify the bundle.\n * - `SnapsWebpackPlugin` to validate the bundle and update the manifest.\n *\n * It can be customized through the `customizeWebpackConfig` function in the\n * snap config, but in most cases, you shouldn't need to do that.\n *\n * @param config - The processed snap Webpack config.\n * @param options - The Webpack options.\n * @returns The default Webpack configuration.\n */\nexport async function getDefaultConfiguration(\n config: ProcessedWebpackConfig,\n options: WebpackOptions = {\n evaluate: config.evaluate,\n },\n): Promise<Configuration> {\n const spinnerText = options.spinner?.text;\n const builtInResolver =\n config.stats.builtIns &&\n new SnapsBuiltInResolver(config.stats.builtIns, options.spinner);\n\n return {\n /**\n * The target is set to `browserslist` so that Webpack will compile the\n * bundle to support the browsers specified in the `.browserslistrc` file.\n * This Browserslist file contains the browsers that are supported by\n * MetaMask Snaps.\n *\n * @see https://webpack.js.org/configuration/target/\n */\n target: `browserslist:${BROWSERSLIST_FILE}`,\n\n /**\n * The mode is set to `production` by default, so that Webpack will minify\n * and optimize the bundle.\n *\n * @see https://webpack.js.org/configuration/mode/\n */\n mode: 'production',\n\n /**\n * The entry point is set to the `input` value from the config object.\n *\n * @see https://webpack.js.org/configuration/entry-context/\n */\n entry: config.input,\n\n /**\n * The devtool option controls how source maps are generated. We set it to\n * the `sourceMap` value from the config object.\n *\n * @see https://webpack.js.org/configuration/devtool/\n */\n devtool: getDevTool(config.sourceMap),\n\n /**\n * The stats option controls how much information is printed to the console\n * when Webpack is running. We set it to `none` so that we can control the\n * output ourselves.\n *\n * @see https://webpack.js.org/configuration/stats/\n */\n stats: 'none',\n\n /**\n * The output options.\n *\n * @see https://webpack.js.org/configuration/output/\n */\n output: {\n /**\n * This indicates whether Webpack should clear the output directory\n * before building. We set it to the `clean` value from the config\n * object.\n *\n * @see https://webpack.js.org/configuration/output/#outputclean\n */\n clean: config.output.clean,\n\n /**\n * The filename of the bundle. We set it to the `filename` value from\n * the config object.\n *\n * @see https://webpack.js.org/configuration/output/#outputfilename\n */\n filename: config.output.filename,\n\n /**\n * The path to the output directory. We set it to the `path` value from\n * the config object.\n *\n * @see https://webpack.js.org/configuration/output/#outputpath\n */\n path: config.output.path,\n\n /**\n * The public path of the bundle. We set it to `/` by default, so that\n * the bundle can be loaded from the root of the server.\n *\n * @see https://webpack.js.org/configuration/output/#outputpublicpath\n */\n publicPath: '/',\n\n /**\n * The library configuration. This tells Webpack how to export the\n * bundle.\n *\n * @see https://webpack.js.org/configuration/output/#outputlibrary\n */\n library: {\n /**\n * This tells Webpack to export the bundle as a CommonJS module. This\n * is necessary for MetaMask Snaps.\n *\n * @see https://webpack.js.org/configuration/output/#outputlibrarytarget\n */\n type: 'commonjs',\n },\n },\n\n /**\n * The module configuration. This is where we tell Webpack how to handle\n * different types of files.\n *\n * @see https://webpack.js.org/configuration/module/\n */\n module: {\n rules: [\n {\n test: /\\.[tj]sx?$/u,\n exclude: /node_modules/u,\n use: await getDefaultLoader(config),\n },\n\n config.experimental.wasm && {\n test: /\\.wasm$/u,\n use: {\n loader: resolve(__dirname, 'loaders', 'wasm'),\n },\n },\n ],\n },\n\n /**\n * The resolve configuration. This tells Webpack how to resolve imports.\n * We set it to resolve `.js` and `.ts` files.\n *\n * @see https://webpack.js.org/configuration/resolve/\n */\n resolve: {\n /**\n * The extensions to resolve. We set it to resolve `.js` and `.ts`\n * files.\n */\n extensions: ['.js', '.ts'],\n\n /**\n * The fallback options. This tells Webpack how to handle imports that\n * aren't resolved. By default, we set Node.js built-ins to `false`, so\n * that they are ignored.\n */\n fallback: Object.fromEntries(builtinModules.map((name) => [name, false])),\n\n /**\n * The plugins to use. We use the {@link SnapsBuiltInResolver} to show\n * warnings about using Node.js built-ins, when no fallback is specified.\n */\n plugins: [builtInResolver],\n },\n\n /**\n * The plugins to use.\n *\n * @see https://webpack.js.org/configuration/plugins/\n */\n plugins: [\n /**\n * The `SnapsWebpackPlugin` is a Webpack plugin that checks and updates\n * the manifest file, and evaluates the bundle in SES. While not strictly\n * required, it's highly recommended to use this plugin.\n */\n new SnapsWebpackPlugin({\n manifestPath: config.manifest.path,\n writeManifest: config.manifest.update,\n eval: !options.watch && options.evaluate,\n }),\n\n /**\n * The `SnapsStatsPlugin` is a Webpack plugin that handles the stats\n * output. It's used to show the stats in the terminal, in a format that\n * is easy to read.\n */\n new SnapsStatsPlugin({ verbose: config.stats.verbose }, options.spinner),\n\n /**\n * The `EnvironmentPlugin` is a Webpack plugin that adds environment\n * variables to the bundle. We use it to add the `NODE_ENV` and `DEBUG`\n * environment variables.\n */\n new EnvironmentPlugin(config.environment),\n\n /**\n * The `ProgressPlugin` is a Webpack plugin that logs the progress of\n * the build. We set it to log the progress to the spinner.\n */\n new ProgressPlugin({\n handler: getProgressHandler(options.spinner, spinnerText),\n }),\n\n /**\n * The `SnapsBundleWarningPlugin` is a Webpack plugin that shows a\n * warning when the bundle is potentially incompatible with MetaMask\n * Snaps.\n */\n new SnapsBundleWarningsPlugin(\n {\n builtInResolver,\n builtIns: Boolean(config.stats.builtIns),\n buffer: config.stats.buffer,\n },\n options.spinner,\n ),\n\n /**\n * The `WatchPlugin` is a Webpack plugin that adds extra files to watch\n * for changes. This is useful for rebuilding the bundle when the\n * manifest file changes.\n */\n options.watch &&\n new SnapsWatchPlugin(\n {\n bundle: resolve(config.output.path, config.output.filename),\n evaluate: options.evaluate,\n files: [config.manifest.path],\n },\n options.spinner,\n ),\n ].filter(Boolean),\n\n /**\n * The optimization configuration. This tells Webpack how to optimize the\n * bundle. Most of the time, you won't need to change this, as the default\n * options set by the `mode` option are sufficient.\n */\n optimization: {\n minimize: config.output.minimize,\n\n /**\n * The minimizer to use. We set it to use the `TerserPlugin`.\n */\n minimizer: [\n new TerserPlugin({\n parallel: true,\n }),\n ],\n },\n\n /**\n * The infrastructure logging configuration. This tells Webpack how to\n * log messages.\n *\n * @see https://webpack.js.org/configuration/infrastructure-logging\n */\n infrastructureLogging: {\n /**\n * The level of logging to use. We set it to `none`, so that we can\n * control the output ourselves.\n */\n level: 'none',\n },\n };\n}\n"],"names":["getDefaultConfiguration","config","options","evaluate","spinnerText","spinner","text","builtInResolver","stats","builtIns","SnapsBuiltInResolver","target","BROWSERSLIST_FILE","mode","entry","input","devtool","getDevTool","sourceMap","output","clean","filename","path","publicPath","library","type","module","rules","test","exclude","use","getDefaultLoader","experimental","wasm","loader","resolve","__dirname","extensions","fallback","Object","fromEntries","builtinModules","map","name","plugins","SnapsWebpackPlugin","manifestPath","manifest","writeManifest","update","eval","watch","SnapsStatsPlugin","verbose","EnvironmentPlugin","environment","ProgressPlugin","handler","getProgressHandler","SnapsBundleWarningsPlugin","Boolean","buffer","SnapsWatchPlugin","bundle","files","filter","optimization","minimize","minimizer","TerserPlugin","parallel","infrastructureLogging","level"],"mappings":";;;;+BA0DsBA;;;eAAAA;;;2EA1DS;wBACA;sBAEP;4EACC;yBAEyB;yBAQ3C;uBAMA;;;;;;AAsCA,eAAeA,wBACpBC,MAA8B,EAC9BC,UAA0B;IACxBC,UAAUF,OAAOE,QAAQ;AAC3B,CAAC;IAED,MAAMC,cAAcF,QAAQG,OAAO,EAAEC;IACrC,MAAMC,kBACJN,OAAOO,KAAK,CAACC,QAAQ,IACrB,IAAIC,6BAAoB,CAACT,OAAOO,KAAK,CAACC,QAAQ,EAAEP,QAAQG,OAAO;IAEjE,OAAO;QACL;;;;;;;KAOC,GACDM,QAAQ,CAAC,aAAa,EAAEC,wBAAiB,CAAC,CAAC;QAE3C;;;;;KAKC,GACDC,MAAM;QAEN;;;;KAIC,GACDC,OAAOb,OAAOc,KAAK;QAEnB;;;;;KAKC,GACDC,SAASC,IAAAA,iBAAU,EAAChB,OAAOiB,SAAS;QAEpC;;;;;;KAMC,GACDV,OAAO;QAEP;;;;KAIC,GACDW,QAAQ;YACN;;;;;;OAMC,GACDC,OAAOnB,OAAOkB,MAAM,CAACC,KAAK;YAE1B;;;;;OAKC,GACDC,UAAUpB,OAAOkB,MAAM,CAACE,QAAQ;YAEhC;;;;;OAKC,GACDC,MAAMrB,OAAOkB,MAAM,CAACG,IAAI;YAExB;;;;;OAKC,GACDC,YAAY;YAEZ;;;;;OAKC,GACDC,SAAS;gBACP;;;;;SAKC,GACDC,MAAM;YACR;QACF;QAEA;;;;;KAKC,GACDC,QAAQ;YACNC,OAAO;gBACL;oBACEC,MAAM;oBACNC,SAAS;oBACTC,KAAK,MAAMC,IAAAA,uBAAgB,EAAC9B;gBAC9B;gBAEAA,OAAO+B,YAAY,CAACC,IAAI,IAAI;oBAC1BL,MAAM;oBACNE,KAAK;wBACHI,QAAQC,IAAAA,aAAO,EAACC,WAAW,WAAW;oBACxC;gBACF;aACD;QACH;QAEA;;;;;KAKC,GACDD,SAAS;YACP;;;OAGC,GACDE,YAAY;gBAAC;gBAAO;aAAM;YAE1B;;;;OAIC,GACDC,UAAUC,OAAOC,WAAW,CAACC,sBAAc,CAACC,GAAG,CAAC,CAACC,OAAS;oBAACA;oBAAM;iBAAM;YAEvE;;;OAGC,GACDC,SAAS;gBAACrC;aAAgB;QAC5B;QAEA;;;;KAIC,GACDqC,SAAS;YACP;;;;OAIC,GACD,IAAIC,2BAAkB,CAAC;gBACrBC,cAAc7C,OAAO8C,QAAQ,CAACzB,IAAI;gBAClC0B,eAAe/C,OAAO8C,QAAQ,CAACE,MAAM;gBACrCC,MAAM,CAAChD,QAAQiD,KAAK,IAAIjD,QAAQC,QAAQ;YAC1C;YAEA;;;;OAIC,GACD,IAAIiD,yBAAgB,CAAC;gBAAEC,SAASpD,OAAOO,KAAK,CAAC6C,OAAO;YAAC,GAAGnD,QAAQG,OAAO;YAEvE;;;;OAIC,GACD,IAAIiD,0BAAiB,CAACrD,OAAOsD,WAAW;YAExC;;;OAGC,GACD,IAAIC,uBAAc,CAAC;gBACjBC,SAASC,IAAAA,yBAAkB,EAACxD,QAAQG,OAAO,EAAED;YAC/C;YAEA;;;;OAIC,GACD,IAAIuD,kCAAyB,CAC3B;gBACEpD;gBACAE,UAAUmD,QAAQ3D,OAAOO,KAAK,CAACC,QAAQ;gBACvCoD,QAAQ5D,OAAOO,KAAK,CAACqD,MAAM;YAC7B,GACA3D,QAAQG,OAAO;YAGjB;;;;OAIC,GACDH,QAAQiD,KAAK,IACX,IAAIW,yBAAgB,CAClB;gBACEC,QAAQ5B,IAAAA,aAAO,EAAClC,OAAOkB,MAAM,CAACG,IAAI,EAAErB,OAAOkB,MAAM,CAACE,QAAQ;gBAC1DlB,UAAUD,QAAQC,QAAQ;gBAC1B6D,OAAO;oBAAC/D,OAAO8C,QAAQ,CAACzB,IAAI;iBAAC;YAC/B,GACApB,QAAQG,OAAO;SAEpB,CAAC4D,MAAM,CAACL;QAET;;;;KAIC,GACDM,cAAc;YACZC,UAAUlE,OAAOkB,MAAM,CAACgD,QAAQ;YAEhC;;OAEC,GACDC,WAAW;gBACT,IAAIC,4BAAY,CAAC;oBACfC,UAAU;gBACZ;aACD;QACH;QAEA;;;;;KAKC,GACDC,uBAAuB;YACrB;;;OAGC,GACDC,OAAO;QACT;IACF;AACF"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
_export_star(require("./compiler"), exports);
|
|
6
|
-
_export_star(require("./config"), exports);
|
|
7
|
-
_export_star(require("./plugins"), exports);
|
|
8
|
-
function _export_star(from, to) {
|
|
9
|
-
Object.keys(from).forEach(function(k) {
|
|
10
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
11
|
-
Object.defineProperty(to, k, {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function() {
|
|
14
|
-
return from[k];
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
return from;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/webpack/index.ts"],"sourcesContent":["export * from './compiler';\nexport * from './config';\nexport * from './plugins';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA"}
|