@winner-fed/bundler-esbuild 0.8.13-alpha.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.
Files changed (37) hide show
  1. package/README.md +3 -0
  2. package/bin/bundler-esbuild.js +2 -0
  3. package/dist/build.d.ts +19 -0
  4. package/dist/build.js +102 -0
  5. package/dist/cli.d.ts +1 -0
  6. package/dist/cli.js +74 -0
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.js +23 -0
  9. package/dist/plugins/__sample.d.ts +2 -0
  10. package/dist/plugins/__sample.js +32 -0
  11. package/dist/plugins/alias.d.ts +3 -0
  12. package/dist/plugins/alias.js +96 -0
  13. package/dist/plugins/externals.d.ts +3 -0
  14. package/dist/plugins/externals.js +44 -0
  15. package/dist/plugins/less-plugin-alias/index.d.ts +9 -0
  16. package/dist/plugins/less-plugin-alias/index.js +100 -0
  17. package/dist/plugins/less-plugin-alias/types.d.ts +4 -0
  18. package/dist/plugins/less-plugin-alias/types.js +17 -0
  19. package/dist/plugins/less-plugin-alias/utils.d.ts +2 -0
  20. package/dist/plugins/less-plugin-alias/utils.js +60 -0
  21. package/dist/plugins/less.d.ts +9 -0
  22. package/dist/plugins/less.js +207 -0
  23. package/dist/plugins/nodeGlobalsPolyfill.d.ts +2 -0
  24. package/dist/plugins/nodeGlobalsPolyfill.js +38 -0
  25. package/dist/plugins/style.d.ts +17 -0
  26. package/dist/plugins/style.js +171 -0
  27. package/dist/plugins/watchRebuild.d.ts +4 -0
  28. package/dist/plugins/watchRebuild.js +67 -0
  29. package/dist/types.d.ts +59 -0
  30. package/dist/types.js +40 -0
  31. package/dist/utils/getBrowserlist.d.ts +1 -0
  32. package/dist/utils/getBrowserlist.js +33 -0
  33. package/dist/utils/postcssProcess.d.ts +3 -0
  34. package/dist/utils/postcssProcess.js +58 -0
  35. package/dist/utils/sortByAffix.d.ts +4 -0
  36. package/dist/utils/sortByAffix.js +40 -0
  37. package/package.json +33 -0
@@ -0,0 +1,58 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/utils/postcssProcess.ts
30
+ var postcssProcess_exports = {};
31
+ __export(postcssProcess_exports, {
32
+ postcssProcess: () => postcssProcess
33
+ });
34
+ module.exports = __toCommonJS(postcssProcess_exports);
35
+ var import_postcss = __toESM(require("postcss"));
36
+ var import_getBrowserlist = require("./getBrowserlist");
37
+ async function postcssProcess(config, css, path) {
38
+ return await (0, import_postcss.default)(
39
+ [
40
+ require("postcss-flexbugs-fixes"),
41
+ require("postcss-preset-env")({
42
+ browsers: (0, import_getBrowserlist.getBrowserlist)((config == null ? void 0 : config.targets) || {}),
43
+ autoprefixer: {
44
+ flexbox: "no-2009",
45
+ ...config == null ? void 0 : config.autoprefixer
46
+ },
47
+ stage: 3
48
+ })
49
+ ].concat((config == null ? void 0 : config.extraPostCSSPlugins) || [])
50
+ ).process(css, {
51
+ from: path,
52
+ to: path
53
+ });
54
+ }
55
+ // Annotate the CommonJS export names for ESM import in node:
56
+ 0 && (module.exports = {
57
+ postcssProcess
58
+ });
@@ -0,0 +1,4 @@
1
+ export declare function sortByAffix(opts: {
2
+ arr: string[];
3
+ affix: string;
4
+ }): string[];
@@ -0,0 +1,40 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/utils/sortByAffix.ts
20
+ var sortByAffix_exports = {};
21
+ __export(sortByAffix_exports, {
22
+ sortByAffix: () => sortByAffix
23
+ });
24
+ module.exports = __toCommonJS(sortByAffix_exports);
25
+ function sortByAffix(opts) {
26
+ return opts.arr.sort((a, b) => {
27
+ if (a.endsWith(opts.affix) && b.endsWith(opts.affix))
28
+ return 0;
29
+ if (a.endsWith(opts.affix))
30
+ return -1;
31
+ if (b.endsWith(opts.affix))
32
+ return 1;
33
+ else
34
+ return 0;
35
+ });
36
+ }
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ sortByAffix
40
+ });
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@winner-fed/bundler-esbuild",
3
+ "version": "0.8.13-alpha.0",
4
+ "license": "MIT",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "bin": {
8
+ "bundler-esbuild": "bin/bundler-esbuild.js"
9
+ },
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "dependencies": {
14
+ "enhanced-resolve": "5.9.3",
15
+ "postcss": "^8.4.29",
16
+ "postcss-flexbugs-fixes": "5.0.2",
17
+ "postcss-preset-env": "7.5.0",
18
+ "@winner-fed/utils": "0.8.13-alpha.0",
19
+ "@winner-fed/bundler-utils": "0.8.13-alpha.0"
20
+ },
21
+ "devDependencies": {
22
+ "@alitajs/postcss-plugin-px2rem": "^0.0.1"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "scripts": {
28
+ "build": "win-scripts father build",
29
+ "build:deps": "win-scripts bundleDeps",
30
+ "dev": "win-scripts father dev",
31
+ "test": "win-scripts jest-turbo"
32
+ }
33
+ }