tiny-vue/examples/react-site/scripts/build-react.mjs

75 lines
1.6 KiB
JavaScript
Raw Permalink Normal View History

feat(react): merge react-dev to dev (#531) * 组件库 react 版本的 button 组件实现,0 - 1 实现 react 复用 vue 逻辑 (#341) * refactor: A constructor name should not start with a lowercase letter but a uppercase. * feat: 查看样式 less 问题 * feat: react版本 button api 功能实现,移除 lock 文件 * feat: react版本 button api 功能实现,修复 pr 问题 * feat: react版本 button api 功能实现,lock 文件更改 * feat: react版本 button api 功能实现,lock 文件更改 * feat: react版本 button api 功能实现,多余注释删除 --------- Co-authored-by: guoxudong06 <guoxudong06@meituan.com> * feat: tiny-react event module, imitate vue event system (#405) * feat: tiny-react props resolver,to get events & attrs from props (#408) * feat: utils of packages/react-common (#409) * feat: replacing some rendering logic in jsx with virtual components (#412) * feat: tiny-react svg render function (#406) * feat: data responsive core, registering responsive objects through us… (#416) * feat: data responsive core, registering responsive objects through useReactive * feat: Modify the passing values of path attributes in the code * Add a virtual machine like proxy for fiber component nodes (#442) * feat(react): Add related operations to the fiber tree (#431) * Add related operations to the fiber tree * Make some optimizations for fiber operations * feat: simulate Vue Composite API (#445) * feat: 添加 tiny-react 的 alert 组件 (#477) * feat(react): Packaging and building React series components (#493) * feat: 打包构建 react 系组件 * feat: 打包构建 react 系组件 * feat(react): Fix the React dev development link (#510) * feat: 修复开发链路 * feat: 修复开发链路 * fix: 修改 scope * fix: 修复导入后缀 * fix: 修复导入后缀 * fix: tsx 运行报错,改回 jsx * fix: 打包 react 组件排出 react 运行依赖 * fix: 修复打包无法通过命令参数自定义 npmscope 和版本问题 * feat(react): 在 packages/react 下添加 readme 文件 --------- Co-authored-by: Mr.栋子 <guoxiaodong@MrdongzideMacBook-Pro.local> * fix(react): Development and debugging environment adjustment (#527) * fix: 开发链路调整 * fix: react dev 开发命令入口修复 --------- Co-authored-by: Mr.栋子 <guoxiaodong@MrdongzideMacBook-Pro.local> * feat(react): 添加 react-site api 文档项目 (#528) Co-authored-by: Mr.栋子 <guoxiaodong@MrdongzideMacBook-Pro.local> * fix: 打包代码 scope 为 @opentiny 会无限循环替换修复 (#529) Co-authored-by: Mr.栋子 <guoxiaodong@MrdongzideMacBook-Pro.local> --------- Co-authored-by: guoxudong06 <guoxudong06@meituan.com> Co-authored-by: Mr.栋子 <guoxiaodong@MrdongzideMacBook-Pro.local>
2023-09-28 19:39:05 +08:00
import { build, defineConfig } from 'vite4'
import fg from 'fast-glob'
import { getBabelOutputPlugin } from '@rollup/plugin-babel'
function createEntry() {
const entries = fg.sync(
['demos/**/*.jsx']
)
return entries.reduce((pre, item) => {
pre[
item
.replace('demos/app/', '')
.replace('.jsx', '')
] = item
return pre
}, ({}))
}
const entries = createEntry()
function prependPlugin(options) {
return {
name: 'prepend-plugin',
generateBundle(_, bundle) {
for (const fileName in bundle) {
const chunk = bundle[fileName];
if (chunk.isEntry) {
chunk.code = `${options.code}\n${chunk.code}`;
}
}
},
};
}
async function buildReact() {
await build({
...defineConfig({
publicDir: false,
extensions: ['.js', '.ts', '.tsx', '.jsx'],
plugins: []
}),
configFile: false,
build: {
outDir: './src/webcomps',
emptyOutDir: true,
minify: false,
rollupOptions: {
plugins: [
getBabelOutputPlugin({
presets: [['@babel/preset-env', { loose: true, modules: false }]]
}),
prependPlugin({
code: `import React from 'react'`
})
],
output: {
strict: false,
manualChunks: {}
},
external: [
/^@pe-3/,
/^@opentiny/,
/^react/
]
},
lib: {
entry: entries,
formats: ['es'],
fix color-picker bug and update changelog (#631) * docs: update release notes (#397) * fix Playground Page (#399) * fix(sites): 切换 sites 引用 @opentiny/vue-repl包 * fix(sites): fix Playground Page * fix(sites): fix (#400) * feat(release): delete color-picker * feat(release): delete color-picker * feat(release): fix grid tips contentMethod * fix(playground): fix process.env \ changeVersion \sortablejs bugs (#422) * fix(sites): fix grid demo api link jump error url (#421) * fix(form-demo): add form validateField api demo (#424) * fix: fix demo import vue-modal; fix playground share (#428) * fix(playground): fix process.env \ changeVersion \sortablejs bugs * fix: fix demo import vue-modal; fix playground share * fix: import Modal (#430) * fix(select): Fix label not displaying correctly when using optimization attribute in select component (#438) * fix(search): the enter bug of the search component is fixed (#439) * feat(release): fix grid watch data * feat(grid): fix grid custom tooltip * fix: fix grid pager events * docs: fix the problem of missing container component style (#453) * docs(container): fix container composition demos fix #425 (#441) * docs: remove :::warning * fix(checkbox): fix checkbox selected icon bug close #450 (#451) * fix: fix input attrs id * fix(slider): fix slider range demo bug * fix: fix when datetime component in dialog-box, the popper scroll away; fix dialog-box (#455) * fix(mobile-tabbar): fixed a tabbar component switchover issue on the mobile client (#458) * fix(slider): fix upload destory bug * fix(smb-theme): smb theme change fix (#469) * fix(checkbox): fix checkbox group wrap (#467) * fix(dropdown): Fix the issue of incorrect theme icons for Dropdown components. (#468) * fix(dropdown-item): (#472) Fix DropdownItem component clicking to disable menu items but triggering item-click event * fix(button): button smb theme change fix (#470) * fix(button): button smb theme change fix * fix(checkbox-button): smb theme change fix * fix(playground): fix jump to incorrect demo (#466) * fix(link): smb theme change fix (#474) * fix(theme): smb theme change fix (#480) * fix(grid): fix grid checkbox radio x-design theme * chore(ts): change code style for import ts type (#511) * fix(Cascader, DropDown, Popeditor): fixed Cascader component panel not closing when clicked elsewhere (#513) * fix(popper): fix popper element offset error in micro-app (#570) * chore(popper): stop bubbling when parent is fixed * fix(popper): fix popper element in micro-app * feat: update code * Merge branch 'dev' of github.com:opentiny/tiny-vue into release * fix(docs): add support vue2.7 docs (#630) * fix(docs): add support vue2.7 docs * fix: fix version * fix: fix color-picker error * docs: update changelog v3.11.0 (#629) * fix: update site version --------- Co-authored-by: Kagol <kagol@sina.com> Co-authored-by: 申君健 <40288193@qq.com> Co-authored-by: gimmyhehe <975402925@qq.com> Co-authored-by: MomoPoppy <125256456+MomoPoppy@users.noreply.github.com> Co-authored-by: chenxi-20 <76168465+chenxi-20@users.noreply.github.com> Co-authored-by: yoyo <104079404+yoyo201626@users.noreply.github.com>
2023-10-24 15:06:31 +08:00
fileName: (_, entryName) => `${entryName}.js`
feat(react): merge react-dev to dev (#531) * 组件库 react 版本的 button 组件实现,0 - 1 实现 react 复用 vue 逻辑 (#341) * refactor: A constructor name should not start with a lowercase letter but a uppercase. * feat: 查看样式 less 问题 * feat: react版本 button api 功能实现,移除 lock 文件 * feat: react版本 button api 功能实现,修复 pr 问题 * feat: react版本 button api 功能实现,lock 文件更改 * feat: react版本 button api 功能实现,lock 文件更改 * feat: react版本 button api 功能实现,多余注释删除 --------- Co-authored-by: guoxudong06 <guoxudong06@meituan.com> * feat: tiny-react event module, imitate vue event system (#405) * feat: tiny-react props resolver,to get events & attrs from props (#408) * feat: utils of packages/react-common (#409) * feat: replacing some rendering logic in jsx with virtual components (#412) * feat: tiny-react svg render function (#406) * feat: data responsive core, registering responsive objects through us… (#416) * feat: data responsive core, registering responsive objects through useReactive * feat: Modify the passing values of path attributes in the code * Add a virtual machine like proxy for fiber component nodes (#442) * feat(react): Add related operations to the fiber tree (#431) * Add related operations to the fiber tree * Make some optimizations for fiber operations * feat: simulate Vue Composite API (#445) * feat: 添加 tiny-react 的 alert 组件 (#477) * feat(react): Packaging and building React series components (#493) * feat: 打包构建 react 系组件 * feat: 打包构建 react 系组件 * feat(react): Fix the React dev development link (#510) * feat: 修复开发链路 * feat: 修复开发链路 * fix: 修改 scope * fix: 修复导入后缀 * fix: 修复导入后缀 * fix: tsx 运行报错,改回 jsx * fix: 打包 react 组件排出 react 运行依赖 * fix: 修复打包无法通过命令参数自定义 npmscope 和版本问题 * feat(react): 在 packages/react 下添加 readme 文件 --------- Co-authored-by: Mr.栋子 <guoxiaodong@MrdongzideMacBook-Pro.local> * fix(react): Development and debugging environment adjustment (#527) * fix: 开发链路调整 * fix: react dev 开发命令入口修复 --------- Co-authored-by: Mr.栋子 <guoxiaodong@MrdongzideMacBook-Pro.local> * feat(react): 添加 react-site api 文档项目 (#528) Co-authored-by: Mr.栋子 <guoxiaodong@MrdongzideMacBook-Pro.local> * fix: 打包代码 scope 为 @opentiny 会无限循环替换修复 (#529) Co-authored-by: Mr.栋子 <guoxiaodong@MrdongzideMacBook-Pro.local> --------- Co-authored-by: guoxudong06 <guoxudong06@meituan.com> Co-authored-by: Mr.栋子 <guoxiaodong@MrdongzideMacBook-Pro.local>
2023-09-28 19:39:05 +08:00
}
}
})
}
buildReact()