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

atpl-loader 编译包含 include 指令的模板时不能正常终止进程 #2

Open
hotoo opened this issue Sep 9, 2016 · 9 comments

Comments

@hotoo
Copy link

hotoo commented Sep 9, 2016

代码见 https://github.com/hotoo/atpl-include-problem

@hotoo
Copy link
Author

hotoo commented Sep 9, 2016

@sorrycc @ziluo

@ziluo
Copy link
Contributor

ziluo commented Sep 9, 2016

OK,我来跟进处理下

@hotoo
Copy link
Author

hotoo commented Sep 9, 2016

有进展么?

@ziluo
Copy link
Contributor

ziluo commented Sep 10, 2016

问题定位

这个问题是因为在解析到include关键字的时候起了一个watch的命令去实时检测子模板的变化,所以正常build之后不能终止进程

解决方案

由于无法在atpl-loader里面判断用户是在进行build或者server,所以目前的解决方案是用户在命令脚本增加atpl=watch来开启子模板的watch命令,如下

"start": "rm -rf dist && NODE_ENV=production atpl=watch webpack"

代码实现详见:https://github.com/ziluo/primer-template/blob/bugfix/src/preParse.js#L35-L37

@hotoo 看下

@hotoo
Copy link
Author

hotoo commented Sep 10, 2016

@hotoo
Copy link
Author

hotoo commented Sep 12, 2016

不改的话就这样也行,合并了发个新版吧。

@hotoo
Copy link
Author

hotoo commented Sep 12, 2016

@ziluo

@ziluo
Copy link
Contributor

ziluo commented Sep 13, 2016

好的,今天发布新版

@hotoo
Copy link
Author

hotoo commented Sep 14, 2016

  1. 可以正常终止了。
  2. 但是 watch touch 并不会触发 webpack 的编译,因为内容并没有变更。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants