Create a cordova project
npm install --save-dev gulp-cordova-create
const create = require('gulp-cordova-create');
gulp.task('build', () => {
return gulp.src('dist')
.pipe(create());
});
This will generate a Cordova project in the .cordova
directory. It will copy the contents of the dist
directory
to the www
directory of the cordova project.
You can pass in extra options to change the initial configuration of the project.
const create = require('gulp-cordova-create');
gulp.task('build', () => {
const options = {
dir: 'myproject',
id: 'com.myproject.hello',
name: 'MyProject'
};
return gulp.src('dist')
.pipe(create(options));
});
This will execute the following command
$ cordova create myproject com.myproject.hello MyProject
And then it will copy the content of the dist
directory to the www
directory of the cordova project.
Type: string
Default: .cordova
The name of the output directory.
Type: string
Default: io.cordova.hellocordova
The reverse domain-style identifier of the project.
Type: string
Default: HelloCordova
The application's display title.
Type: object
Default: undefined
Content to include in the cordova build.json
.
See Using build.json
section of cordova documentation for posible configurations.
See gulp-cordova
for the full list of available packages.
MIT © Sam Verschueren