Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

[BUG] 无法生成 json, axml, acss 等文件,内容全为undefined #209

Closed
newset opened this issue Sep 9, 2019 · 6 comments
Closed
Labels
bug Something isn't working

Comments

@newset
Copy link
Member

newset commented Sep 9, 2019

看了下代码

https://github.com/remaxjs/remax/blob/develop/packages/remax-cli/src/build/plugins/template.ts#L171

      const manifest = createAppManifest(options, adapter.name, context);
      bundle[manifest.fileName] = manifest;

这种直接在bundle添加属性的方式好像不能生效了,只能调用 this.emitFile 添加文件

需要修改为

   this.emitFile({
     type: 'asset',
     ...manifest
  })
@newset newset added the bug Something isn't working label Sep 9, 2019
@Darmody
Copy link
Contributor

Darmody commented Sep 9, 2019

怎么复现呢

@newset
Copy link
Member Author

newset commented Sep 9, 2019

怎么复现呢

https://github.com/remaxjs/todo-demo/tree/dva/alipay

这个分支的代码,直接就运行就会出现

image

@newset
Copy link
Member Author

newset commented Sep 9, 2019

rollup 昨天发了个新的版本,1.21.0, 应该是这个版本有改动。我把rollup换成 前一个版本1.20.3
就没问题了。然后可以锁定 rollup 版本,或者修改template.ts 里面的这部分逻辑代码 @yesmeck @Darmody

@yesmeck
Copy link
Member

yesmeck commented Sep 9, 2019

rollup 发了个有 breaking change 的版本,看 rollup 怎么解决 rollup/rollup#3104 。临时方案:

"resolutions": {
  "rollup": "1.20.3"
},

https://yarnpkg.com/lang/en/docs/selective-version-resolutions/

@yesmeck
Copy link
Member

yesmeck commented Sep 9, 2019

rollup 那边改了,不过我们还是要把现在这种非标准的方式改成 emitFile

@newset
Copy link
Member Author

newset commented Sep 16, 2019

#228

@newset newset closed this as completed Sep 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants