如何从aurelia.json中捆绑文件

时间:2016-09-13 17:27:20

标签: aurelia aurelia-cli

我想阻止src / config.js捆绑在scripts / app-bundle.js中

我之前看到的语法是:

 "bundles": {
          "dist/app-build": {
              "includes": [
                  "[**/*.js]",
                  "**/*.html!text",
                  "**/*.css!text",
                  "cloneya",
                  "dexie",
                  "jquery",
                  "jquery-ui",
                  "medium-editor-webpack",
                  "moment",
                  "polymer/mutationobservers",
                  "safe-json-stringify"
              ],
              excludes: [
                  "config.js" // So our wildcard globbing doesn't include this config file
              ],
...

然而,新语法不同:aurelia.json:

  "bundles": [
            {
                "name": "app-bundle.js",
                "source": [
                    "[**/*.js]",
                    "**/*.{css,html}"
                ],
                "excludes" : [
                    "**/config.js"
                ]
            },

我的冥想'排除'声明没有做到这一点

1 个答案:

答案 0 :(得分:0)

解决方案实际上是在GitHub页面上提供的:https://github.com/aurelia/cli

  

或者,您可以通过设置源来定义排除列表   属性是包含include和exclude数组的对象   模式。当您尝试定义多个时,这很有用   来自您的源代码的捆绑包。

{
  "name": "app-bundle.js",
  "source": {
    "include": [
      "[**/*.js]",
      "**/*.{css,html}"
    ],
    "exclude": [
      "**/sub-module/**/*",
    ]
  }
},
{
  "name": "sub-module-bundle.js",
  "source": [
    "**/sub-module/**/*",
  ]
}

确保您有版本> 0.19.0