Gulp没有将js文件注入index.html

时间:2018-03-08 02:55:26

标签: angularjs gulp inject gulp-inject

当我运行我的任务时,它说文件被注入到控制台中的index.html;但实际上没有在index.html文件中注入js文件。

我的任务功能如下

gulp.task('testing', function() {
  gulp.src('../dist/app/index.html')
  .pipe(debug())
  .pipe(inject(gulp.src('../dist/app/js/*.js', {read: false}), {relative: true}))
  .pipe(debug())
  .pipe(gulp.dest('../dist/app/js'));
});

我正在使用gulp3.9.1和gulp-inject版本3.0.0,任何帮助都是提前感谢。

1 个答案:

答案 0 :(得分:1)

似乎指定的目标路径指向js目录' ../ dist / app / js ' 查看新文件是否在 js 文件夹中。如果是,您可能不希望 / js 参与路径

您也可以尝试添加

-bash-4.2$ sqlplus hr/hr

SQL*Plus: Release 11.2.0.2.0 Production on Tue Apr 10 15:40:04 2018

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL> create table test_table (col1 date, col2 number, col3 number, col4 varchar2(30));

Table created.

SQL> insert into test_table (col1,col2,col3,col4) values (sysdate, 1,1234,'@T!ger');

1 row created.

SQL> commit;

Commit complete.

SQL> select * from test_table;

COL1                     COL2       COL3 COL4
------------------ ---------- ---------- ------------------------------
10-APR-18                   1       1234 @T!ger

SQL> exit


#!/bin/sh
test_num1='1234'
test_char2='@T!ger'

sqlplus  hr/hr <<!

    UPDATE TEST_TABLE SET col1=SYSDATE , col2=4  WHERE col3='${test_num1}' AND col4='${test_char2}' ;
    commit;
    exit;
!

bash-4.2$ ./test_sql.sh

SQL*Plus: Release 11.2.0.2.0 Production on Tue Apr 10 16:11:08 2018

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL> SQL>
1 row updated.

SQL>
Commit complete.

SQL> Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

在您希望注入js脚本的地方的index.html