@absolutejs/absolute 0.1.7 → 0.1.8
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 +62 -62
- package/package.json +1 -1
- package/src/core/build.ts +7 -0
package/package.json
CHANGED
package/src/core/build.ts
CHANGED
|
@@ -29,7 +29,9 @@ export const build = async ({
|
|
|
29
29
|
htmlDir
|
|
30
30
|
}:BuildConfig = {}) => {
|
|
31
31
|
const start = performance.now();
|
|
32
|
+
console.log("Building start");
|
|
32
33
|
|
|
34
|
+
console.log("Creating build directory");
|
|
33
35
|
const projectRoot = cwd();
|
|
34
36
|
const buildDirAbsolute = join(projectRoot, buildDir);
|
|
35
37
|
const assetsDirAbsolute = join(projectRoot, assetsDir);
|
|
@@ -39,9 +41,11 @@ export const build = async ({
|
|
|
39
41
|
const reactPagesDirAbsolute = reactPagesDir && join(projectRoot, reactPagesDir);
|
|
40
42
|
const htmlDirAbsolute = htmlDir && join(projectRoot, htmlDir);
|
|
41
43
|
|
|
44
|
+
console.log("Cleaning build directory");
|
|
42
45
|
await rm(buildDirAbsolute, { force: true, recursive: true });
|
|
43
46
|
await mkdir(buildDirAbsolute);
|
|
44
47
|
|
|
48
|
+
console.log("Generating React index files");
|
|
45
49
|
(reactPagesDirAbsolute && reactIndexDirAbsolute) && await generateReactIndexFiles(
|
|
46
50
|
reactPagesDirAbsolute,
|
|
47
51
|
reactIndexDirAbsolute
|
|
@@ -77,6 +81,7 @@ export const build = async ({
|
|
|
77
81
|
.concat(javascriptEntryPaths)
|
|
78
82
|
.concat(typeScriptEntryPaths);
|
|
79
83
|
|
|
84
|
+
console.log("Building entry points");
|
|
80
85
|
const { logs, outputs } = await bunBuild({
|
|
81
86
|
entrypoints: entryPaths,
|
|
82
87
|
format: "esm",
|
|
@@ -94,12 +99,14 @@ export const build = async ({
|
|
|
94
99
|
console.info(log);
|
|
95
100
|
});
|
|
96
101
|
|
|
102
|
+
console.log("Copying assets to build directory");
|
|
97
103
|
await copyAssetsTobuildDirAbsolute(
|
|
98
104
|
assetsDirAbsolute,
|
|
99
105
|
buildDirAbsolute,
|
|
100
106
|
projectRoot
|
|
101
107
|
);
|
|
102
108
|
|
|
109
|
+
console.log("Generating manifest");
|
|
103
110
|
const manifest = outputs.reduce<Record<string, string>>((acc, artifact) => {
|
|
104
111
|
let relativePath = artifact.path;
|
|
105
112
|
|