Skip to content

Commit ae38a55

Browse files
author
linfeng
committed
feat: add project root id to pri config
1 parent bf00d91 commit ae38a55

4 files changed

Lines changed: 11 additions & 2 deletions

File tree

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@
2222
},
2323
"[typescript]": {
2424
"editor.defaultFormatter": "esbenp.prettier-vscode"
25+
},
26+
"editor.codeActionsOnSave": {
27+
"source.fixAll.eslint": true
2528
}
2629
}

src/built-in-plugins/command-docs/plugin/dev-docs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ function prepare(docsEntryPath: string) {
172172
173173
const Docs = () => <DocsWrapper docs={DocComponents}/>
174174
175-
const ROOT_ID = 'root';
175+
const ROOT_ID = '${pri.sourceConfig.rootId}';
176176
177177
setConfig({ pureSFC: true, pureRender: true })
178178

src/utils/create-entry.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as fs from 'fs-extra';
22
import * as path from 'path';
3+
import { pri } from '../node';
34
import * as pipe from '../node/pipe';
45
import { PRI_PACKAGE_NAME } from './constants';
56
import { globalState } from './global-state';
@@ -158,7 +159,7 @@ export class Entry {
158159
import * as Loadable from "react-loadable"
159160
import App, { pageLoadableMap } from "./app"
160161
161-
const ROOT_ID = "root"
162+
const ROOT_ID = "${pri.sourceConfig.rootId}"
162163
`,
163164
);
164165
}

src/utils/define.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,11 @@ export class ProjectConfig {
257257
* Enable hot loader
258258
*/
259259
public hotReload = true;
260+
261+
/**
262+
* Project Root Dom Id
263+
*/
264+
public rootId = 'root';
260265
}
261266

262267
export type SetPipe = (pipeName: string, callback: PipeCallback) => void;

0 commit comments

Comments
 (0)