@cubing/dev-config 0.2.0 → 0.3.1

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/README.md CHANGED
@@ -5,11 +5,12 @@
5
5
  ### `esbuild`
6
6
 
7
7
  ```js
8
- import { es2022 } from "@cubing/dev-config/esbuild/es2022";
8
+ // Or use `es2022Lib`
9
+ import { es2022App } from "@cubing/dev-config/esbuild/es2022";
9
10
  import { build } from "esbuild";
10
11
 
11
12
  await build({
12
- ...es2022,
13
+ ...es2022App({ dev: true }),
13
14
  entryPoints: ["./src/index.ts"],
14
15
  outdir: "./dist/lib/",
15
16
  });
@@ -1,9 +1,5 @@
1
- export declare const es2022: {
2
- readonly format: "esm";
3
- readonly target: "es2022";
4
- readonly bundle: true;
5
- readonly splitting: true;
6
- readonly chunkNames: "chunks/[name]-[hash]";
7
- readonly sourcemap: true;
8
- readonly packages: "external";
9
- };
1
+ import type { BuildOptions } from "esbuild";
2
+ export declare function es2022App(options?: {
3
+ dev?: boolean;
4
+ }): BuildOptions;
5
+ export declare function es2022Lib(): BuildOptions;
@@ -1,14 +1,21 @@
1
- // src/esbuild/es2022/index.ts
2
- var es2022 = {
1
+ "use strict";
2
+ const common = {
3
3
  format: "esm",
4
4
  target: "es2022",
5
5
  bundle: true,
6
6
  splitting: true,
7
7
  chunkNames: "chunks/[name]-[hash]",
8
- sourcemap: true,
9
- packages: "external"
8
+ sourcemap: true
10
9
  };
11
- export {
12
- es2022
13
- };
14
- //# sourceMappingURL=index.js.map
10
+ export function es2022App(options) {
11
+ return {
12
+ ...common,
13
+ minify: !options?.dev
14
+ };
15
+ }
16
+ export function es2022Lib() {
17
+ return {
18
+ ...es2022App,
19
+ packages: "external"
20
+ };
21
+ }
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@cubing/dev-config",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
+ "type": "module",
4
5
  "dependencies": {
5
6
  "esbuild": "^0.25.3"
6
7
  },
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/esbuild/es2022/index.ts"],
4
- "sourcesContent": ["import type { BuildOptions } from \"esbuild\";\n\nexport const es2022 = {\n format: \"esm\",\n target: \"es2022\",\n\n bundle: true,\n splitting: true,\n\n chunkNames: \"chunks/[name]-[hash]\",\n sourcemap: true,\n\n packages: \"external\",\n} as const satisfies BuildOptions;\n"],
5
- "mappings": ";AAEO,IAAM,SAAS;AAAA,EACpB,QAAQ;AAAA,EACR,QAAQ;AAAA,EAER,QAAQ;AAAA,EACR,WAAW;AAAA,EAEX,YAAY;AAAA,EACZ,WAAW;AAAA,EAEX,UAAU;AACZ;",
6
- "names": []
7
- }