Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 0d172bc

Browse files
committed
fix(tasks): respect config.build.publicPath
1 parent b2e1f74 commit 0d172bc

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"clean": "lerna clean",
1818
"version": "lerna version --conventional-commits",
1919
"release": "lerna publish from-package",
20-
"fmt": "prettier --write /**/*.{js,json,css,md}",
20+
"fmt": "prettier --write **/*.{js,json,css,md}",
2121
"lint": "eslint . --cache --ext .js"
2222
},
2323
"repository": {

packages/fusuma/src/tasks/index.js

+13-7
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,28 @@ async function tasks({ type, options }) {
1717
config = await fusuma.read(basePath);
1818
} catch (e) {
1919
warn('config', `it seems fusumarc doesn't exist, you can run "fusuma init" command`);
20-
} finally {
21-
if (config.meta && config.meta.url && config.build && !config.build.publicPath) {
20+
}
21+
22+
if (config.meta && config.meta.url) {
23+
if (!config.build) {
24+
config.build = {};
25+
}
26+
27+
if (!config.build.publicPath) {
2228
try {
2329
const { pathname } = new URL(config.meta.url);
2430

25-
config.build.publicPath = pathname;
31+
config.build.publicPath = `${pathname}/`;
2632
} catch (e) {
2733
error('preparation', `meta.url specified isn't a URL`);
2834
}
2935
}
30-
31-
config = fusuma.combine(config, {
32-
internal: { ...options, basePath, inputDirPath, outputDirPath },
33-
});
3436
}
3537

38+
config = fusuma.combine(config, {
39+
internal: { ...options, basePath, inputDirPath, outputDirPath },
40+
});
41+
3642
switch (type) {
3743
case 'init':
3844
return require('./init')(config);

0 commit comments

Comments
 (0)