aui / tmodjs

前端模板外置解决方案
666 stars 189 forks source link

运行tmod命令后,package.json会变化,combo:true设置被清除 #71

Open beiduo opened 9 years ago

beiduo commented 9 years ago

我使用的是windows 7系统的git shell。

一开始,package.json文件原本是(直接拷贝的test目录的)

{
    "name": "template",
    "version": "1.0.1",
    "dependencies": {
        "tmodjs": "1.0.1-rc9"
    },
    "tmodjs-config": {
        "output": "./build",
        "charset": "utf-8",
        "syntax": "simple",
        "helpers": null,
        "escape": true,
        "compress": true,
        "type": "default",
        "runtime": "template.js",
        "combo": true,
        "minify": true,
        "cache": false
    }
}

然后我运行

tmod ./tpl --output ./build --type amd

之后,package.json就自动变成了

{
    "name": "template",
    "version": "1.0.1",
    "dependencies": {
        "tmodjs": "1.0.1"
    },
    "tmodjs-config": {
        "output": "../build",
        "charset": "utf-8",
        "syntax": "simple",
        "helpers": null,
        "escape": true,
        "compress": true,
        "type": "amd",
        "runtime": "template.js",
        "alias": null,
        "minify": true,
        "cache": false
    }
}

combo: true 被去掉了,其他设置也有所修改。

于是也未能得到合并过的文件。

不知道是哪个步骤出错了……~

aui commented 9 years ago
  1. 命令行输入的路径是相对于工作目录,而 package.json 的路径是相对于自身,从命令行输入的路径会进行转换后写入到 package.json
  2. tmodjs 输出的 amd 模块不支持 combo 配置,故会修正
beiduo commented 9 years ago

啊,我试了下使用default这个type后可以合并,应该是这样。thanks!