0
私のアプリケーションではgulp-inject
を使用していますが、私はの修正方法を実行中にエラーになりますか?`gulp-inject`が` gulp.src`のために用意されているのでしょうか? '
console
:
PS F:\Nissan-Gulp> gulp
[14:38:38] Using gulpfile F:\Nissan-Gulp\gulpfile.js
[14:38:38] Starting 'server'...
[14:38:38] Finished 'server' after 22 ms
[14:38:38] Starting 'inject'...
[14:38:38] 'inject' errored after 19 ms
[14:38:38] Error in plugin 'gulp-inject'
Message:
There is no `read` option. Did you mean to provide it for `gulp.src` perhaps?
[14:38:38] Server started http://localhost:9000
[14:38:38] LiveReload started on port 35729
私のコード:
gulp.task("inject", function() {
var sources = gulp.src(['./app/scripts/**/*.js', './app/stylesheets/**/*.css' ], {read: false}, {relative: true});
return gulp.src('./app/index.html')
.pipe(inject(sources, {
read: false,
ignorePath: '/app'
}))
.pipe(gulp.dest('./app'));
});
私のhtmlコード:
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/stylesheets/main.css">
<!-- bower:css -->
<!-- endbower -->
<!-- inject:css -->
<!-- endinject -->
</head>
<body>
<!-- bower:js -->
<!-- endbower -->
<!-- inject:js -->
<!-- endinject -->
</body>