Skip to content

Commit 86b2973

Browse files
ZEJIA-LIUliuzejia
andauthored
feat: 为京东小程序添加editor组件 (#16167)
Co-authored-by: liuzejia <[email protected]>
1 parent 034a278 commit 86b2973

File tree

5 files changed

+20
-1
lines changed

5 files changed

+20
-1
lines changed

packages/taro-jd/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"url": "https://github.com/NervJS/taro/issues"
2828
},
2929
"dependencies": {
30+
"@tarojs/components": "workspace:*",
3031
"@tarojs/service": "workspace:*",
3132
"@tarojs/shared": "workspace:*"
3233
},

packages/taro-jd/rollup.config.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,15 @@ const runtimeUtilsConfig = {
4242
...base
4343
}
4444

45-
module.exports = [compileConfig, runtimeConfig, runtimeUtilsConfig]
45+
// React 下 webpack 会 alias @tarojs/components 为此文件
46+
const otherConfig = {
47+
input: path.join(cwd, 'src/components-react.ts'),
48+
output: {
49+
file: path.join(cwd, 'dist/components-react.js'),
50+
format: 'es',
51+
sourcemap: true
52+
},
53+
...base
54+
}
55+
56+
module.exports = [compileConfig, runtimeConfig, runtimeUtilsConfig, otherConfig]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from '@tarojs/components/mini'
2+
export const Editor = 'editor'
3+

packages/taro-jd/src/program.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default class JD extends TaroPlatformBase {
1010
globalObject = 'jd'
1111
projectConfigJson = 'project.jd.json'
1212
runtimePath = `${PACKAGE_NAME}/dist/runtime`
13+
taroComponentsPath = `${PACKAGE_NAME}/dist/components-react`
1314
fileType = {
1415
templ: '.jxml',
1516
style: '.jxss',

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)