Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: improve github action #5234

Closed
wants to merge 195 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
7730140
chore(deps): bump postcss-modules-local-by-default from 1.2.0 to 3.0.…
dependabot-preview[bot] Dec 11, 2019
ac039e8
fix(components): 修复 Image 组件在 react 环境下报错的问题
luckyadam Dec 12, 2019
1d17269
fix(components): h5 image 删除无关代码 (#4998)
Lostsory Dec 13, 2019
b0ec706
feat: checkout from auto-docs
ZakaryCode Dec 15, 2019
338650a
feat(cli): 尝试接入 webpack 来编译各端小程序
luckyadam May 13, 2019
e5a9fca
feat(cli): 拆分逻辑到 loader
luckyadam May 15, 2019
97cc0e1
feat(cli): 将 app/页面/组件 添加到入口文件进行编译
luckyadam May 23, 2019
36d8ac9
refactor(transformer): 任何情况返回都返回相同的 result
yuche May 28, 2019
5f78126
fix(transformer): 修复测试用例
yuche May 28, 2019
d4b38be
refactor(transformer): isApp 不再是必填参数
yuche May 28, 2019
62f71a5
fix(transformer): 支持直接 import default
yuche May 28, 2019
4771c21
fix(cli): 编译器参数调整
luckyadam May 28, 2019
ed9e755
fix(cli): lerna 加入 taro-mini-runner && 接入 webpack 生成小程序文件
luckyadam May 28, 2019
f08eac9
refactor(transformer): isNormal 变为可选参数
yuche May 29, 2019
3bc5450
fix(cli): 普通文件经过编译器编译必须传入 isNormal
luckyadam May 29, 2019
f209936
feat(cli): 调整文件编译
luckyadam May 29, 2019
8eb3d43
feat(taro-mini-runner): 拆分文件编译成为 plugin
luckyadam Jun 4, 2019
1041ffe
feat(taro-mini-runner): 引入拆分的公共 chunks
luckyadam Jun 4, 2019
15dede3
feat(taro-mini-runner): 生成页面以及组件的 usingComponents 配置
luckyadam Jun 4, 2019
9029d25
feat(taro-mini-runner): 生成多端类型文件
luckyadam Jun 5, 2019
65c699d
feat(taro-mini-runner): 优化文件生成
luckyadam Jun 5, 2019
302e878
feat(taro-mini-runner): 如果是组件需要补充 component:true 配置
luckyadam Jun 5, 2019
18bc2bc
fix(cli): 支持引用 node_modules 中组件
luckyadam Jun 14, 2019
2ea3205
feat(mini-runner): 增加 Taro 模块专有处理插件
luckyadam Jun 17, 2019
413f9f7
feat(cli): 增加 tapable 包
luckyadam Jun 17, 2019
1a5a903
fix(cli): 修复代码合并的问题
luckyadam Jun 17, 2019
f012d26
fix(transformer): 修复错误类型
yuche Jun 17, 2019
b77f00a
feat(cli): 借助 tapable 改造
luckyadam Jun 17, 2019
13ab8b0
feat(cli): cli 支持事件 && 小程序编译配置向 H5 看齐
luckyadam Jun 19, 2019
9f19372
fix(cli): 修复目录创建
luckyadam Jun 24, 2019
0b47af5
feat(taro): 调整小程序和 H5 的编译配置
luckyadam Jun 25, 2019
8578d17
feat(taro-cli): 调整 rn 编译配置
luckyadam Jun 25, 2019
6abb72b
feat(mini-runner): 支持分包
luckyadam Jun 26, 2019
975efa2
fix(mini-runner): npm 中文件不会经过 taro 包替换操作
luckyadam Jun 26, 2019
43a129a
feat(mini-runner): 支持编译 tabBar 上引用的资源编译
luckyadam Jun 26, 2019
56369d4
feat(mini-runner): 支持与原生小程序代码混写
luckyadam Jun 26, 2019
c861872
fix(mini-runner): 只有 taro 的包不能经过依赖包名替换
luckyadam Jul 4, 2019
27612a3
fix(mini-runner): 修复引用 npm 中组件间存在依赖时依赖路径解析错误的问题
luckyadam Jul 10, 2019
6e8a4ff
fix(mini-runner): 打包优化,引用自 npm 包中的组件不抽离至 vendors 中
luckyadam Jul 10, 2019
0ee1a7f
chore: merge master
luckyadam Aug 20, 2019
2e13173
fix(taro): 小程序 webpack 编译静态文件路径
luckyadam Aug 26, 2019
48ba4d8
fix(mini-runner): 优化 webpack 编译时样式处理
luckyadam Aug 26, 2019
678ddd4
feat(mini-runner): 加入 watch
luckyadam Aug 27, 2019
aa9f99e
fix(cli): 修复 watch 时文件修改不对的问题
luckyadam Sep 3, 2019
ddf2199
chore: merge master
luckyadam Sep 4, 2019
0d7e5c8
feat(taro): 加入快应用编译支持
luckyadam Sep 5, 2019
d469c84
fix(mini-runner): 提前解析快应用页面
luckyadam Sep 8, 2019
4fd3152
feat(mini-runner): 生成快应用页面及组件
luckyadam Sep 9, 2019
236ebaa
feat(mini-runner): 保证快应用文件生成正确
luckyadam Sep 16, 2019
07134d7
feat(mini-runner): 优化 watch
luckyadam Sep 16, 2019
c84b683
fix(mini-runner): 修复 watch bug
luckyadam Sep 18, 2019
e64e177
chore: merge
luckyadam Sep 18, 2019
de78fe4
fix(jd): 修复合并代码导致的京东小程序的编译问题
luckyadam Sep 18, 2019
cac8473
chore: 修复语法报错问题
luckyadam Sep 18, 2019
7251ea3
fix(mini-runner): 修复普通小程序编译的问题
luckyadam Sep 23, 2019
a58909d
fix(webpack): 修复文件压缩的问题
luckyadam Sep 24, 2019
f80016f
feat(taro): cli 配合 mini-runner 重构 && 支持使用 mini-runner 编译插件
luckyadam Oct 8, 2019
1e8aef1
fix(mini-runner): 修复小程序编译报错
luckyadam Oct 15, 2019
e38ebc7
fix(mini-runner): 支持快应用编译后模板与样式的检测
luckyadam Oct 15, 2019
5019023
fix(mini-runner): 修复对 css modules 的支持
luckyadam Oct 15, 2019
2a26e20
fix: pxtransform disable on quick-app
ZakaryCode Oct 17, 2019
127d6d2
fix(cli): 修复 doctor 对 config 的检测
luckyadam Oct 17, 2019
179be5c
fix(cli): 清理代码
luckyadam Oct 17, 2019
4597d1a
fix(mini-runner): 加上文件编译提示
luckyadam Oct 22, 2019
121ba14
fix(cli): 修复配置文件中读取不到 process.env.TARO_ENV 的问题
luckyadam Oct 22, 2019
3f1aa7d
fix(taro-quickapp): 修复快应用事件绑定异常问题
luckyadam Oct 22, 2019
42eb4c4
fix: position linter for quickapp 1060+
ZakaryCode Oct 22, 2019
55c4bed
chore(taro): 规范类型定义文件命名
Garfield550 Oct 22, 2019
de5dc7b
fix(mini-runner): 修复快应用编译后页面标题展示不正确的问题
luckyadam Oct 22, 2019
5a7638e
fix(taro): 修复快应用下拉刷新问题
luckyadam Oct 22, 2019
d17a8c5
fix(cli): 更新默认模板
luckyadam Oct 23, 2019
e9a25b8
fix(mini-runner): 修复 builder 的 hooks 调用
luckyadam Oct 23, 2019
95bc24d
docs: 更新新的配置文档
luckyadam Oct 23, 2019
77d7aeb
fix(mini-runner): 修复 tabbar 编译及组件 watch 的问题
luckyadam Oct 24, 2019
2796e46
feat: audio context
ZakaryCode Oct 24, 2019
a26c41a
feat: mock for quickapp
ZakaryCode Oct 27, 2019
c263ee6
fix: quickapp api upload from docs
ZakaryCode Oct 28, 2019
7477c76
chore: merge master
luckyadam Oct 28, 2019
ca7bdb7
fix(mini-runner): 修复快应用打包报错的问题
luckyadam Oct 28, 2019
b3b21bf
fix(components-qa): 修复页面 onReachBottom 事件不触发的问题
luckyadam Oct 29, 2019
1c2fa60
fix(quickapp): pull-down-refresh page-scroll
ZakaryCode Oct 31, 2019
dbc27c5
feat: stop trans asset for quickapp
ZakaryCode Oct 31, 2019
0598df6
fix: somethings no need
ZakaryCode Oct 31, 2019
931a208
fix(mini-runner): 移除无用代码
luckyadam Nov 5, 2019
5041342
chore(release): publish v2.0.0-beta.0
luckyadam Nov 5, 2019
f928f51
chore: changelog
luckyadam Nov 5, 2019
325758b
merge
luckyadam Nov 12, 2019
547085b
chore(release): publish v2.0.0-beta.1
luckyadam Nov 13, 2019
2661430
chore: changelog
luckyadam Nov 13, 2019
2e09509
fix(mini-runner): 修复对 alias 的支持
luckyadam Nov 14, 2019
e7dec0a
chore(release): publish v2.0.0-beta.2
luckyadam Nov 14, 2019
3ca1aa2
chore: changelog && docs
luckyadam Nov 14, 2019
cd264dd
fix(taro-cli): update package list 新增 @tarojs/mini-runner,对列表排序
Garfield550 Nov 15, 2019
2a4bd98
docs: 更新异步编程文档
luckyadam Nov 18, 2019
6ccfe83
feat(docs): 更新 2.0 版本使用 async-await 的文档 #4837
Garfield550 Nov 19, 2019
d8898f1
fix(mini-runner): 组件引入支持统一从一个入口文件中引入
luckyadam Nov 19, 2019
174c7b2
fix(mini-runner): 更新编译时提示
luckyadam Nov 19, 2019
ab1a9da
chore(release): publish v2.0.0-beta.3
luckyadam Nov 19, 2019
fa35918
chore: changelog
luckyadam Nov 19, 2019
9647e8a
docs(readme): 增加版本选择提示
Garfield550 Nov 19, 2019
48f3443
chore: 更新 i18n 文件
Garfield550 Nov 19, 2019
a5cbb98
fix(cli): 更新默认模板
luckyadam Nov 21, 2019
71b34eb
fix(template): 更新 Taro 2.0 的模版和下载地址 #4837
Garfield550 Nov 21, 2019
860c3b9
feat(taro-cli): 配置文件分开存放,优化 taro config 输出
Garfield550 Nov 21, 2019
83322ec
feat(components-qa): 增强快应用button组件,增加属性判断及点击变色等 (#4882)
Nov 21, 2019
21c5754
chore(release): publish v2.0.0-beta.4
luckyadam Nov 21, 2019
6531a1f
chore: changelog && docs
luckyadam Nov 21, 2019
955784f
fix(mini-runner): 修复小程序编译时样式中引用静态资源转换为 base64
luckyadam Nov 27, 2019
70dde62
fix(mini-runner): 修复 watch 时文件报错导致无法重新编译的问题,fix #4949
luckyadam Nov 28, 2019
89896a5
docs: 去除已经废除的h5.webpack配置
Littly Nov 28, 2019
6e15d16
fix(cli): 修正快应用依赖项安装命令在windows不兼容问题 (#4954)
Nov 28, 2019
52032dd
fix(mini-runner): 快应用页面路径编译错误
luckyadam Nov 28, 2019
9c336f5
fix(components-qa): 改进 button 动画效果展示,引入 css 属性描述文件 (#4898)
Nov 30, 2019
1f9b8d6
fix修正快应用Manifest配置文件,在windows下json转换时反斜杆‘\\’路径问题 (#4979)
Dec 2, 2019
2c61570
fix(mini-runner): 修正快应用pages中ux文件未正确生成问题 (#4969)
Dec 2, 2019
3649db5
fix(cli): 解决 cli 编译时缺少 @types/react 依赖问题 (#4997)
Dec 3, 2019
e1e979d
fix(mini-runner): 修复 sass 变量失效的问题,close #4893
luckyadam Dec 3, 2019
b0c68cf
fix(mini-runner): 加入 preval 支持
luckyadam Dec 3, 2019
6798787
fix(mini-runner): 修复 windows 下编译后 taro 引用错误的问题
luckyadam Dec 3, 2019
4d4d080
fix(mini-runner): 组件中 $componentPath 路径生成不对
luckyadam Dec 3, 2019
e4616eb
fix(mini-runner): 组件引用支持 import as 语法
luckyadam Dec 3, 2019
eacfd6a
chore(release): publish v2.0.0-beta.5
luckyadam Dec 3, 2019
0dcd247
chore: changelog && docs
luckyadam Dec 3, 2019
98c82da
fix(mini-runner): 修复分包页面丢失的问题
luckyadam Dec 4, 2019
fc20fc4
chore(release): publish v2.0.0-beta.6
luckyadam Dec 4, 2019
b201639
chore: changelog && docs
luckyadam Dec 4, 2019
60bfe5c
fix(taro-webpack-runner): 修复 sassLoaderOption 未定义的问题
Garfield550 Dec 5, 2019
d8e180c
fix(mini-runner): 优化 watch 时文件编译速度
luckyadam Dec 5, 2019
4635bec
fix(mini-runner): 修复页面 hooks config 失效问题
luckyadam Dec 5, 2019
201a991
feat(taro-runner-utils): 添加 @tarojs/runner-utils 包
Garfield550 Dec 5, 2019
765c8de
fix(taro-runner-utils): 优化代码,修复找不到类型定义的问题
Garfield550 Dec 6, 2019
d799097
feat: webpack-runner 和 mini-runner 代码优化
Garfield550 Dec 6, 2019
97a1642
feat(taro-runner-utils): 添加单元测试和优化注释
Garfield550 Dec 6, 2019
7dac473
fix(taro): 增加递归查找中止条件,修正拼写错误 (#5045)
Dec 10, 2019
cca8c72
fix(mini-runner): 增加快应用公共属性的自动更新,优化button动画直接调用 (#5044)
Dec 10, 2019
09dd6b7
fix(mini-runner): 修复包未安装不报错的问题
luckyadam Dec 11, 2019
03967de
fix(mini-runner): 修复引用原生组件报错的问题
luckyadam Dec 11, 2019
9d58a87
fix(mini-runner): 修复引用原生组件编译后样式文件缺失的问题
luckyadam Dec 11, 2019
3d3118e
fix(mini-runner): 暴露 commonChunks 配置以供自定义公共 chunks 生成
luckyadam Dec 11, 2019
86a7372
chore(release): publish v2.0.0-beta.7
luckyadam Dec 11, 2019
24701e6
fix(mini-runner): 修复使用 preval 报错的问题
luckyadam Dec 12, 2019
cd36ca1
fix: for video objectFit
ZakaryCode Dec 12, 2019
d920785
chore(deps-dev): bump enzyme from 3.9.0 to 3.10.0 (#4875)
dependabot-preview[bot] Dec 12, 2019
9685cea
chore(deps-dev): bump babel-preset-jest from 22.4.4 to 25.0.0 (#4623)
dependabot-preview[bot] Dec 12, 2019
54b95f7
chore(release): publish v2.0.0-beta.8
luckyadam Dec 12, 2019
4bfaebb
chore: changelog && docs
luckyadam Dec 12, 2019
debdae6
docs: 更新 readme
luckyadam Dec 12, 2019
4fc3e62
chore(deps): [security] bump mixin-deep from 1.3.1 to 1.3.2 (#5073)
dependabot-preview[bot] Dec 13, 2019
40de9f7
chore(deps): bump ejs from 2.7.1 to 3.0.1 (#5075)
dependabot-preview[bot] Dec 13, 2019
61ee57c
docs: 增加特别鸣谢
luckyadam Dec 13, 2019
a560edb
fix(mini-runner): 修复 defineConstants 小程序表现与 H5 不一致问题 close #5078
Garfield550 Dec 13, 2019
de9ef7d
chore(deps-dev): bump @types/enzyme from 3.9.1 to 3.10.4 (#5082)
dependabot-preview[bot] Dec 14, 2019
80086c8
chore(deps-dev): bump @types/webpack from 4.4.31 to 4.41.0 (#5081)
dependabot-preview[bot] Dec 14, 2019
37af02e
fix: use rimraf instead of rm to fixed Windows build error
Garfield550 Dec 16, 2019
9e40489
chore(deps): bump klaw from 2.1.1 to 3.0.0 (#5097)
dependabot-preview[bot] Dec 17, 2019
3a84775
fix(cli): 2.0.0-beta.8. 编译RN报错 'babel' of undefined close #5093
Pines-Cheng Dec 17, 2019
6ecb39e
chore(deps-dev): bump rollup-plugin-postcss from 1.6.3 to 2.0.3 (#5113)
dependabot-preview[bot] Dec 18, 2019
fd19662
chore(release): publish v2.0.0-beta.9
yuche Dec 18, 2019
4ac67e2
chore: changelog & docs
yuche Dec 18, 2019
c984109
fix(types): add enableFlex to ScrollViewProps (#5142)
SunskyXH Dec 20, 2019
7c042fa
快应用自定义组件调用,进行相对路径转换
Dec 20, 2019
4f848b2
增加Button Loading动画类型选择,默认与原生组件保持一致
Dec 20, 2019
3e849cc
chore(release): publish v2.0.0-beta.10
yuche Dec 20, 2019
ca929a8
chore: changelog & docs
yuche Dec 20, 2019
1a6f314
docs: update readme
luckyadam Dec 22, 2019
03a7672
fix(mini-runner): 编译时需要移除对组件文件的引用
luckyadam Dec 23, 2019
9267765
fix(cli): 插件编译失败,close #5149
luckyadam Dec 23, 2019
769ded0
fix(mini-runner): 修复 watch 时增加组件文件的 bug,close #5140
luckyadam Dec 23, 2019
bf2af74
fix(mini-runner): 编译时移除组件文件引用,遗漏了 npm 包中组件,close #5139
luckyadam Dec 24, 2019
38279ec
fix(taro): update getStorage return typings (#5170)
waiwaic Dec 24, 2019
e703bd6
fix(mini-runner): 降低 babel-plugin-preval 版本以保证使用 async await 时不报错
luckyadam Dec 24, 2019
0760a99
chore(transformer-wx): 缺少 babel-plugin-preval 包
luckyadam Dec 24, 2019
ff7463d
fix(cli): 增加运行提示
luckyadam Dec 24, 2019
def32f5
fix(mini-runner): 修复多端文件引用的问题,close #5175
luckyadam Dec 25, 2019
ab22ee1
chore(release): publish v2.0.0-beta.11
luckyadam Dec 25, 2019
bbd8e64
chore: changelog && docs
luckyadam Dec 25, 2019
8c49f05
chore: 确保文档发布过程中持续输出内容,避免 ci 失败
luckyadam Dec 26, 2019
a0ccc36
fix(mini-runner): 修复静态资源引用的 bug
luckyadam Dec 26, 2019
8c95471
chore(release): publish v2.0.0-beta.12
luckyadam Dec 26, 2019
abbe71a
chore: changelog && docs
luckyadam Dec 26, 2019
f3564ba
docs: 增加Button在快应用doc中属性兼容说明 (#5202)
Dec 27, 2019
e71d8e9
feat(docs):增加windows下基于vscode单步调测配置说明 (#5201)
Dec 27, 2019
85a48d8
chore(deps): [security] bump handlebars from 4.0.11 to 4.5.3 (#5200)
dependabot-preview[bot] Dec 27, 2019
801bb80
fix(mini-runner): 支持自定义 tabBar
luckyadam Dec 30, 2019
8cfd5bb
fix(mini-runner): 修复组件 watch 时改动不生效的问题
luckyadam Dec 30, 2019
b5394c7
fix(mini-runner): 修复 watch 时修改页面导致组件无法及时更新的问题
luckyadam Dec 31, 2019
4455175
chore(release): publish v2.0.0-beta.13
luckyadam Dec 31, 2019
505fe4d
chore: changelog && docs
luckyadam Dec 31, 2019
3a20fe4
feat(h5): chooseImage回调中加入了originalFileObj属性
Littly Dec 31, 2019
23aca91
fix(types): 补充 chooseImage 在 H5 下的类型
Garfield550 Jan 2, 2020
368550d
docs: 更新文档
luckyadam Jan 2, 2020
35ba9c1
fix(mini-runner): 修复生产打包时公共样式无法插入的问题
luckyadam Jan 2, 2020
17b9b31
feat(rn): taro React Native 依赖由 0.55.4 升级到 0.59.9
Pines-Cheng Jan 3, 2020
4fbeb30
docs: update rn doc
Pines-Cheng Jan 3, 2020
5f5b36a
chore: improve github action
gengjiawen Jan 3, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(cli): 调整文件编译
luckyadam committed Dec 31, 2019
commit f209936de2fc5640e7f5af46b8d150d8b68268f3
2 changes: 2 additions & 0 deletions packages/taro-cli/src/mini/webpack.ts
Original file line number Diff line number Diff line change
@@ -43,12 +43,14 @@ async function buildWithWebpack ({ appPath }: { appPath: string }) {
entry: {
app: entryFilePath
},
sourceDir,
outputDir,
buildAdapter,
plugins: {
babel: babelConfig
},
isWatch: !isProduction,
constantsReplaceList,
designWidth: projectConfig.designWidth,
deviceRatio: projectConfig.deviceRatio
}
4 changes: 4 additions & 0 deletions packages/taro-mini-runner/package.json
Original file line number Diff line number Diff line change
@@ -43,10 +43,14 @@
"babel-types": "^6.26.0",
"better-babel-generator": "^6.26.1",
"chalk": "^2.4.2",
"file-loader": "^3.0.1",
"fs-extra": "^8.0.1",
"loader-utils": "^1.2.3",
"lodash": "^4.17.11",
"node-sass": "^4.12.0",
"ora": "^3.4.0",
"sass-loader": "^7.1.0",
"virtual-module-webpack-plugin": "^0.4.1",
"webpack": "^4.31.0",
"webpack-chain": "^6.0.0",
"webpack-format-messages": "^2.0.5"
22 changes: 21 additions & 1 deletion packages/taro-mini-runner/src/index.ts
Original file line number Diff line number Diff line change
@@ -42,7 +42,27 @@ export default function build (config: IBuildConfig) {
fileTypeMap: MiniPlugin.getTaroFileTypeMap()
}
}]
}
},
{
test: /\.(scss|wxss|acss|)$/,
include: /src/,
use: [
{
loader: require.resolve('file-loader'),
options: {
useRelativePath: true,
name: `[path][name].wxss`,
context: config.sourceDir
}
},
{
loader: require.resolve('sass-loader'),
options: {

},
},
],
}
]
},
plugins: [
4 changes: 4 additions & 0 deletions packages/taro-mini-runner/src/loaders/loader.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default function (source) {
console.log(source)
return source
}
15 changes: 4 additions & 11 deletions packages/taro-mini-runner/src/loaders/wxTransformerLoader.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
import { getOptions } from 'loader-utils'
import wxTransformer from '@tarojs/transformer-wx'

import { REG_TYPESCRIPT, PARSE_AST_TYPE } from '../utils/constants'
import { REG_TYPESCRIPT } from '../utils/constants'

export default function wxTransformerLoader (source) {
const { buildAdapter, fileTypeMap } = getOptions(this)
const { buildAdapter } = getOptions(this)
const filePath = this.resourcePath
const wxTransformerParams: any = {
code: source,
sourcePath: filePath,
isTyped: REG_TYPESCRIPT.test(filePath),
adapter: buildAdapter
}
if (fileTypeMap[filePath]) {
const fileType = fileTypeMap[filePath].type
if (fileType === PARSE_AST_TYPE.ENTRY) {
wxTransformerParams.isApp = true
} else if (fileType === PARSE_AST_TYPE.PAGE) {
wxTransformerParams.isRoot = true
}
adapter: buildAdapter,
isNormal: true
}
const transformResult = wxTransformer(wxTransformerParams)
this.callback(null, transformResult.code, transformResult.ast)
22 changes: 19 additions & 3 deletions packages/taro-mini-runner/src/plugins/miniPlugin.ts
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ import * as FunctionModulePlugin from 'webpack/lib/FunctionModulePlugin'
import * as NodeSourcePlugin from 'webpack/lib/node/NodeSourcePlugin'
import * as JsonpTemplatePlugin from 'webpack/lib/JsonpTemplatePlugin'
import * as LoaderTargetPlugin from 'webpack/lib/LoaderTargetPlugin'
import * as VirtualModulePlugin from 'virtual-module-webpack-plugin'
import { defaults } from 'lodash'
import * as t from 'babel-types'
import traverse from 'babel-traverse'
@@ -25,7 +26,8 @@ interface ITaroFileInfo {
[key: string]: {
type: PARSE_AST_TYPE,
config: IConfig,
wxml?: string
wxml?: string,
code?: string
}
}

@@ -200,7 +202,8 @@ export default class MiniPlugin {
taroFileTypeMap[this.appEntry] = {
type: PARSE_AST_TYPE.ENTRY,
config: configObj,
wxml: transformResult.template
wxml: transformResult.template,
code: transformResult.code
}
this.pages = new Set([
...appPages.map(item => {
@@ -225,7 +228,8 @@ export default class MiniPlugin {
taroFileTypeMap[file.path] = {
type: isRoot ? PARSE_AST_TYPE.PAGE : PARSE_AST_TYPE.COMPONENT,
config: configObj,
wxml: transformResult.template
wxml: transformResult.template,
code: transformResult.code
}
let depComponents = transformResult.components
if (depComponents && depComponents.length) {
@@ -277,11 +281,23 @@ export default class MiniPlugin {
})
}

transferFileContent (compiler: webpack.Compiler) {
Object.keys(taroFileTypeMap).forEach(item => {
const relativePath = item.replace(compiler.context, '')
const itemInfo = taroFileTypeMap[item]
new VirtualModulePlugin({
moduleName: relativePath,
contents: itemInfo.code
}).apply(compiler)
})
}

run (compiler: webpack.Compiler) {
this.appEntry = this.getAppEntry(compiler)
this.getPages()
this.getComponents(this.pages, true)
this.addEntries(compiler)
this.transferFileContent(compiler)
}

static getTaroFileTypeMap () {
3 changes: 3 additions & 0 deletions packages/taro-mini-runner/src/plugins/removeStyleImport.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default class RemoveStyleImportPlugin {

}
453 changes: 435 additions & 18 deletions packages/taro-mini-runner/yarn.lock

Large diffs are not rendered by default.