Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
改动
fix #149 build-config 添加配置
resolve.alias
,详情如下:resolve
类型:
object
对于模块解析行为的配置,在扩展时会合并原值。
resolve
的字段描述如下:resolve.alias
类型:
object
配置别名以控制对特定模块或路径的解析行为;如配置
{ "foo": "src/foo" }
,则模块foo
会被解析到<项目根目录>/src/foo
,模块foo/bar
会被解析到<项目根目录>/src/foo/bar
resolve.alias
的字段描述如下:resolve.alias.(.*)
类型:
string
解析目标的路径(相对于项目根目录),如
"src/foo"
。场景
常见的场景有:
{ "@": "src" }
来实现@
到源代码目录的映射,如@/constants/foo
会被解析到<BUILD_ROOT>/src/constants/foo
portal-base
)中的开发预览项目可以通过配置{ "portal-base": ".." }
来引用 lib 本身的内容,见 https://github.com/qbox/portal-base/pull/647{ "crypto": "crypto-browserify" }
的配置来实现之,详见 Node.js core modules polyfill #151 (comment)