File tree Expand file tree Collapse file tree 2 files changed +32
-3
lines changed Expand file tree Collapse file tree 2 files changed +32
-3
lines changed Original file line number Diff line number Diff line change @@ -767,3 +767,23 @@ module.exports = {
767
767
workers: 1
768
768
}
769
769
```
770
+
771
+ ## 其他一些情况
772
+
773
+ ### windows 支持
774
+
775
+ 由于在 windows 上开发体验不是特别友好,以及一些库缺乏支持,在大部分情况下,我们优先推荐在 mac/linux 下开发 Node.js 应用。
776
+
777
+ 经过我们的测试,在 windows 10 , nodejs 官网下载的 v10 版本的 node 下运行 midway 程序通过,但是无法确保在其他的 windows 版本上能够正常。
778
+
779
+ 推荐使用类似 [ Hyper] ( https://hyper.is/ ) 等相对友好的命令行工具来替换原生的命令行。
780
+
781
+ 需要注意的是,由于 windows 对设置环境变量的同步,默认生成的脚手架可能需要调整,主要是环境变量的部分。
782
+
783
+ 比如开发命令,在设置环境的时候需要使用 ` set ` 以及中间需要增加 ` && ` 以连接命令。
784
+
785
+ ``` json
786
+ {
787
+ "dev" : " set NODE_ENV=local && midway-bin dev --ts"
788
+ }
789
+ ```
Original file line number Diff line number Diff line change @@ -5,16 +5,16 @@ const path = require('path');
5
5
const fs = require ( 'fs' ) ;
6
6
const Parser = require ( './parser' ) ;
7
7
const templateDir = path . join ( __dirname , '../boilerplate/' ) ;
8
+ const os = require ( 'os' ) ;
8
9
9
10
class MidwayInitCommand extends Command {
10
11
11
12
constructor ( options = { } ) {
12
13
super ( Object . assign ( { } , options ) ) ;
13
14
}
14
15
15
- * fetchBoilerplateMapping ( pkgName ) {
16
- const mapping = yield super . fetchBoilerplateMapping ( pkgName ) ;
17
- return Object . assign ( require ( '../boilerplate/boilerplate.json' ) , mapping ) ;
16
+ * fetchBoilerplateMapping ( ) {
17
+ return require ( '../boilerplate/boilerplate.json' ) ;
18
18
}
19
19
20
20
* downloadBoilerplate ( pkgName ) {
@@ -32,6 +32,15 @@ class MidwayInitCommand extends Command {
32
32
getParserOptions ( ) {
33
33
return Parser . getParserOptions ( ) ;
34
34
}
35
+
36
+ printUsage ( ) {
37
+ super . printUsage ( ) ;
38
+ if ( os . platform ( ) === 'win32' ) {
39
+ this . log ( `Since it is windows system, please review this note.
40
+ https://midwayjs.org/midway/guide.html#%E5%90%AF%E5%8A%A8%E5%8F%82%E6%95%B0%E4%BC%A0%E9%80%92
41
+ ` ) ;
42
+ }
43
+ }
35
44
}
36
45
37
46
module . exports = MidwayInitCommand ;
You can’t perform that action at this time.
0 commit comments