1

自分のアプリで ng-boilerplate のスクリプト コンパイル プロセスを複製できるようにしたいのですが、機能させることができません。

index.html の次の行を、アプリ内のすべてのスクリプトのリストにコンパイルすることについて言及しています。

<!-- compiled JavaScript --><% scripts.forEach( function ( file ) { %>
<script type="text/javascript" src="<%= file %>"></script><% }); %>

filterForJS 関数を追加し、gruntfile.js にマルチタスクを登録しましたが、機能していません :(

4

1 に答える 1

2

index タスクのオプションを追加しましたか?

```

/**
 * The `index` task compiles the `index.html` file as a Grunt template. CSS
 * and JS files co-exist here but they get split apart later.
 */
index: {

  /**
   * During development, we don't want to have wait for compilation,
   * concatenation, minification, etc. So to avoid these steps, we simply
   * add all script files directly to the `<head>` of `index.html`. The
   * `src` property contains the list of included files.
   */
  build: {
    dir: '<%= build_dir %>',
    src: [
      '<%= vendor_files.js %>',
      '<%= build_dir %>/src/**/*.js',
      '<%= html2js.common.dest %>',
      '<%= html2js.app.dest %>',
      '<%= vendor_files.css %>',
      '<%= recess.build.dest %>'
    ]
  },

  /**
   * When it is time to have a completely compiled application, we can
   * alter the above to include only a single JavaScript and a single CSS
   * file. Now we're back!
   */
  compile: {
    dir: '<%= compile_dir %>',
    src: [
      '<%= concat.compile_js.dest %>',
      '<%= vendor_files.css %>',
      '<%= recess.compile.dest %>'
    ]
  }
},

```

于 2013-12-10T19:37:04.770 に答える