gulp task for safari app
This commit is contained in:
parent
fda37716a8
commit
67c5c03bdb
33
gulpfile.js
33
gulpfile.js
|
@ -37,7 +37,11 @@ const filters = {
|
|||
],
|
||||
edge: [
|
||||
'!build/edge/**/*'
|
||||
]
|
||||
],
|
||||
nonSafariApp: [
|
||||
'!build/background.html',
|
||||
'!build/popup/index.html'
|
||||
],
|
||||
};
|
||||
|
||||
function buildString() {
|
||||
|
@ -193,6 +197,32 @@ function safariZip(buildPath) {
|
|||
});
|
||||
}
|
||||
|
||||
function distSafariApp(cb) {
|
||||
const buildPath = paths.dist + 'Safari/';
|
||||
const extBuildPath = buildPath + 'app_extension/';
|
||||
const appPath = './src/safari/app/desktop/'
|
||||
|
||||
return del([buildPath + '**/*'])
|
||||
.then(() => copy(appPath + '**/*', extBuildPath))
|
||||
.then(() => safariAppCopyBuild(paths.build + '**/*', extBuildPath + 'safari/app'))
|
||||
.then(() => {
|
||||
return cb;
|
||||
}, () => {
|
||||
return cb;
|
||||
});
|
||||
}
|
||||
|
||||
function safariAppCopyBuild(source, dest) {
|
||||
return new Promise((resolve, reject) => {
|
||||
gulp.src(source)
|
||||
.on('error', reject)
|
||||
.pipe(filter(['**'].concat(filters.edge).concat(filters.fonts).concat(filters.safari)
|
||||
.concat(filters.webExt).concat(filters.nonSafariApp)))
|
||||
.pipe(gulp.dest(dest))
|
||||
.on('end', resolve);
|
||||
});
|
||||
}
|
||||
|
||||
function webfonts() {
|
||||
return gulp.src('./webfonts.list')
|
||||
.pipe(googleWebFonts({
|
||||
|
@ -230,6 +260,7 @@ exports['dist:chrome'] = distChrome;
|
|||
exports['dist:opera'] = distOpera;
|
||||
exports['dist:edge'] = distEdge;
|
||||
exports['dist:safari'] = distSafari;
|
||||
exports['dist:safariApp'] = distSafariApp;
|
||||
exports.dist = gulp.parallel(distFirefox, distChrome, distOpera, distEdge, distSafari);
|
||||
exports['ci:coverage'] = ciCoverage;
|
||||
exports.ci = ciCoverage;
|
||||
|
|
2
jslib
2
jslib
|
@ -1 +1 @@
|
|||
Subproject commit 692d1ec20163edaa404b52888af2ea45b13b59cd
|
||||
Subproject commit ee91cfc2dfda974ab1ae8e0077e58998bbc6e832
|
|
@ -16,6 +16,7 @@
|
|||
"dist:firefox": "npm run build:prod && gulp dist:firefox",
|
||||
"dist:opera": "npm run build:prod && gulp dist:opera",
|
||||
"dist:safari": "npm run build:prod && gulp dist:safari",
|
||||
"dist:safariApp": "npm run build:prod && gulp dist:safariApp",
|
||||
"lint": "tslint src/**/*.ts || true",
|
||||
"lint:fix": "tslint src/**/*.ts --fix",
|
||||
"test": "karma start --single-run",
|
||||
|
|
Loading…
Reference in New Issue