Commit 3c42191c authored by oahehc's avatar oahehc
Browse files

Config: adjust pipe target folder and update document

parent 069f6fd5
......@@ -17,9 +17,33 @@ publish a new version to npm every time you make a change.
Instead, you can directly let the packager output files to specific folder(s) by this command
```
$ yarn pipe /path/to/some/project /path/to/another/project ...
```
1. create pipe clone the file into another project
```
$ yarn pipe /path/to/some/project /path/to/another/project ...
```
2. in the target project, modify the path for `anue-fe-sdk`
- use webpack (fe-desktop, fe-mobile...)
```js
@webpack config file
resolve: {
alias: {
'anue-fe-sdk': path.resolve(process.cwd(), './anue-fe-sdk'),
},
},
```
- for Next.js project (fe-lobby, fe-social-rich...)
```js
@next.config.js
Object.assign(
config.resolve.alias,
aliases.reduce(
{
'anue-fe-sdk': path.resolve(process.cwd(), './anue-fe-sdk'),
}
)
);
```
3. remove anue-fe-sdk folder and aliases config after finish testing
## Analyze Packages
......
......@@ -35,9 +35,9 @@ if (externalProjectPath.length > 0) {
}
syncTimer = setTimeout(() => {
externalProjectPath.forEach(p => {
execSync(`rm -rf ${p}/sdk`)
execSync(`cp -R ${defaultOutputPath} ${p}/sdk`)
execSync(`cp -R ${path.resolve(__dirname, './src/defines')} ${p}/sdk/defines`)
execSync(`rm -rf ${p}/anue-fe-sdk`)
execSync(`cp -R ${defaultOutputPath} ${p}/anue-fe-sdk`)
execSync(`cp -R ${path.resolve(__dirname, './src/defines')} ${p}/anue-fe-sdk/defines`)
console.log(chalk`{green.bold [sync] } successfully sync output files \n{gray ${defaultOutputPath} } {cyan => }${p}`)
})
syncTimer = null
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment