reactive - 环境搭建

packages/reactivity/package.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
// 模块的名称
"name": "@vue/reactivity",
"version": "1.0.0",
// 打包后的文件名称和地址
"module": "dist/reacticity.esm-bundler.js",
"unpkg": "dist/reactivity.global.js",
// 供打包时使用
"buildOptions": {
"name": "VueReactivity",
"formats": [
"esm-bundler",
"esm-browser",
"cjs",
"global"
]
},
}

packages/reactivity/src/reactive.ts

1
2
3
export function reactive() {

}

packages/reactivity/src/effect.ts

1
2
3
export function effect() {

}

packages/reactivity/src/index.ts

1
2
export * from './reactive'
export * from './effect'

packages/shared/package.json

1
2
3
4
5
6
7
8
9
10
11
{
"name": "@vue/shared",
"version": "1.0.0",
"module": "dist/shared.esm-bundler.js",
"buildOptions": {
"formats": [
"esm-bundler",
"cjs"
]
}
}

packages/shared/src/index.ts

1
2
3
export function isObject(value) {
return typeof value === 'object' && value !== null;
}