@modern-js/plugin-module-banner 2.7.0-beta.1 → 2.7.0-beta.3
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/{index.js → cjs/index.js} +3 -23
- package/dist/esm/index.js +23 -0
- package/dist/types/index.d.ts +14 -0
- package/package.json +15 -5
- package/dist/index.d.ts +0 -14
- package/dist/index.js.map +0 -1
|
@@ -1,24 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
-
var __spreadValues = (a, b) => {
|
|
11
|
-
for (var prop in b || (b = {}))
|
|
12
|
-
if (__hasOwnProp.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
if (__getOwnPropSymbols)
|
|
15
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
-
if (__propIsEnum.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
}
|
|
19
|
-
return a;
|
|
20
|
-
};
|
|
21
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
5
|
var __export = (target, all) => {
|
|
23
6
|
for (var name in all)
|
|
24
7
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -32,8 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
32
15
|
return to;
|
|
33
16
|
};
|
|
34
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
|
-
|
|
36
|
-
// src/index.ts
|
|
37
18
|
var src_exports = {};
|
|
38
19
|
__export(src_exports, {
|
|
39
20
|
default: () => src_default
|
|
@@ -49,10 +30,11 @@ var src_default = (options) => ({
|
|
|
49
30
|
if (lastEsbuildOptions) {
|
|
50
31
|
lastEsbuildConfig = lastEsbuildOptions(c);
|
|
51
32
|
}
|
|
52
|
-
return
|
|
33
|
+
return {
|
|
34
|
+
...lastEsbuildConfig,
|
|
53
35
|
footer: options.footer,
|
|
54
36
|
banner: options.banner
|
|
55
|
-
}
|
|
37
|
+
};
|
|
56
38
|
};
|
|
57
39
|
return next(config);
|
|
58
40
|
}
|
|
@@ -60,5 +42,3 @@ var src_default = (options) => ({
|
|
|
60
42
|
});
|
|
61
43
|
// Annotate the CommonJS export names for ESM import in node:
|
|
62
44
|
0 && (module.exports = {});
|
|
63
|
-
|
|
64
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var src_default = (options) => ({
|
|
2
|
+
name: "@modern-js/plugin-module-banner",
|
|
3
|
+
setup: () => ({
|
|
4
|
+
modifyLibuild(config, next) {
|
|
5
|
+
const lastEsbuildOptions = config.esbuildOptions;
|
|
6
|
+
config.esbuildOptions = (c) => {
|
|
7
|
+
let lastEsbuildConfig = {};
|
|
8
|
+
if (lastEsbuildOptions) {
|
|
9
|
+
lastEsbuildConfig = lastEsbuildOptions(c);
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
...lastEsbuildConfig,
|
|
13
|
+
footer: options.footer,
|
|
14
|
+
banner: options.banner
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
return next(config);
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
export {
|
|
22
|
+
src_default as default
|
|
23
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CliPlugin, ModuleTools } from '@modern-js/module-tools';
|
|
2
|
+
|
|
3
|
+
declare const _default: (options: {
|
|
4
|
+
banner: {
|
|
5
|
+
js?: string;
|
|
6
|
+
css?: string;
|
|
7
|
+
};
|
|
8
|
+
footer?: {
|
|
9
|
+
js?: string;
|
|
10
|
+
css?: string;
|
|
11
|
+
};
|
|
12
|
+
}) => CliPlugin<ModuleTools>;
|
|
13
|
+
|
|
14
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -11,9 +11,19 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.7.0-beta.
|
|
15
|
-
"types": "./dist/index.d.ts",
|
|
16
|
-
"main": "./dist/index.js",
|
|
14
|
+
"version": "2.7.0-beta.3",
|
|
15
|
+
"types": "./dist/types/index.d.ts",
|
|
16
|
+
"main": "./dist/cjs/index.js",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"node": {
|
|
20
|
+
"jsnext:source": "./src/index.ts",
|
|
21
|
+
"import": "./dist/esm/index.js",
|
|
22
|
+
"require": "./dist/cjs/index.js"
|
|
23
|
+
},
|
|
24
|
+
"default": "./dist/esm/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
17
27
|
"devDependencies": {
|
|
18
28
|
"@types/jest": "^27",
|
|
19
29
|
"@types/node": "^14",
|
|
@@ -21,8 +31,8 @@
|
|
|
21
31
|
"jest": "^27",
|
|
22
32
|
"@modern-js/libuild": "~0.11.0",
|
|
23
33
|
"@scripts/build": "2.7.0",
|
|
24
|
-
"@
|
|
25
|
-
"@
|
|
34
|
+
"@scripts/jest-config": "2.7.0",
|
|
35
|
+
"@modern-js/module-tools": "2.7.0"
|
|
26
36
|
},
|
|
27
37
|
"peerDependencies": {
|
|
28
38
|
"@modern-js/module-tools": "2.7.0"
|
package/dist/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CliPlugin, ModuleTools } from '@modern-js/module-tools';
|
|
2
|
-
|
|
3
|
-
declare const _default: (options: {
|
|
4
|
-
banner: {
|
|
5
|
-
js: string;
|
|
6
|
-
css: string;
|
|
7
|
-
};
|
|
8
|
-
footer?: {
|
|
9
|
-
js: string;
|
|
10
|
-
css: string;
|
|
11
|
-
};
|
|
12
|
-
}) => CliPlugin<ModuleTools>;
|
|
13
|
-
|
|
14
|
-
export { _default as default };
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAO,cAAQ,CAAC,aAGe;AAAA,EAC7B,MAAM;AAAA,EACN,OAAO,OAAO;AAAA,IACZ,cAAc,QAAQ,MAAM;AAC1B,YAAM,qBAAqB,OAAO;AAClC,aAAO,iBAAiB,OAAK;AAC3B,YAAI,oBAAoB,CAAC;AACzB,YAAI,oBAAoB;AACtB,8BAAoB,mBAAmB,CAAC;AAAA,QAC1C;AAEA,eAAO,iCACF,oBADE;AAAA,UAEL,QAAQ,QAAQ;AAAA,UAChB,QAAQ,QAAQ;AAAA,QAClB;AAAA,MACF;AACA,aAAO,KAAK,MAAM;AAAA,IACpB;AAAA,EACF;AACF;","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { CliPlugin, ModuleTools } from '@modern-js/module-tools';\n\nexport default (options: {\n banner: { js: string; css: string };\n footer?: { js: string; css: string };\n}): CliPlugin<ModuleTools> => ({\n name: '@modern-js/plugin-module-banner',\n setup: () => ({\n modifyLibuild(config, next) {\n const lastEsbuildOptions = config.esbuildOptions;\n config.esbuildOptions = c => {\n let lastEsbuildConfig = {};\n if (lastEsbuildOptions) {\n lastEsbuildConfig = lastEsbuildOptions(c);\n }\n\n return {\n ...lastEsbuildConfig,\n footer: options.footer,\n banner: options.banner,\n };\n };\n return next(config);\n },\n }),\n});\n"]}
|