tweaking build

master
Mark MacKay 2021-06-02 11:55:24 -05:00
parent a72ca7587f
commit 1e76faaa2b
3 changed files with 32 additions and 30 deletions

View File

@ -17,60 +17,65 @@ gulp.task('js', function () {
.pipe(gulp.dest('dist'));
});
gulp.task('loading', function () {
return gulp.src('src/js/loading.js')
.pipe(gulp.dest('dist'));
});
gulp.task('index', function () {
return gulp.src('src/*.html')
.pipe(useref())
.pipe(cachebust({type: 'timestamp'}))
.pipe(gulp.dest('dist'));
return gulp.src('src/*.html')
.pipe(useref())
.pipe(cachebust({type: 'timestamp'}))
.pipe(gulp.dest('dist'));
});
// no service worker implemented yet
gulp.task('cache', function(){
return gulp.src(['./src/serviceworker.js'])
return gulp.src(['./src/serviceworker.js'])
.pipe(replace('<timestamp>', Date.now()))
.pipe(gulp.dest('./dist/'));
});
gulp.task('manifest', function(){
return gulp.src(['./src/site.webmanifest'])
return gulp.src(['./src/site.webmanifest'])
.pipe(gulp.dest('./dist/'));
});
gulp.task('images', function(){
return gulp.src(['src/images/**/*'])
return gulp.src(['src/images/**/*'])
.pipe(gulp.dest('dist/images'));
});
gulp.task('fonts', function(){
return gulp.src(['src/font-files/**/*'])
return gulp.src(['src/font-files/**/*'])
.pipe(gulp.dest('dist/font-files'));
});
gulp.task('extensions', function(){
return gulp.src(['src/extensions/**/*'])
return gulp.src(['src/extensions/**/*'])
.pipe(gulp.dest('dist/extensions'));
});
gulp.task('shapelib', function(){
return gulp.src(['src/shapelib/**/*'])
return gulp.src(['src/shapelib/**/*'])
.pipe(gulp.dest('dist/shapelib'));
});
gulp.task('canvg', function(){
return gulp.src(['src/js/lib/canvg.js', 'src/js/lib/rgbcolor.js'])
return gulp.src(['src/js/lib/canvg.js', 'src/js/lib/rgbcolor.js'])
.pipe(gulp.dest('dist/js/lib'));
});
gulp.task('default',
gulp.series(
'css',
'js',
'index',
'manifest',
'images',
'fonts',
'extensions',
'shapelib',
'canvg'
)
gulp.task('build',
gulp.series(
'css',
'js',
'index',
'manifest',
'images',
'fonts',
'extensions',
'shapelib',
'canvg'
)
);

View File

@ -36,7 +36,7 @@ Install dev dependencies:
Then you can build into `dist` by running:
`gulp`
`gulp build`
Deploy `dist` to your static file server of choice.

View File

@ -757,9 +757,10 @@
<div class="tools_flyout" id="tools_shapelib">
<div id="shape_buttons"></div>
</div>
<!-- build:js loading.js -->
<script type="text/javascript" src="js/loading.js"></script>
<!-- build:js all.js -->
<!-- endbuild -->
<!-- build:js all.js -->
<script type="text/javascript" src="js/lib/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="js/lib/pathseg.js"></script>
<script type="text/javascript" src="js/lib/jquery.hotkeys.min.js"></script>
@ -807,15 +808,11 @@
<script type="text/javascript" src="js/lib/jpicker.min.js"></script>
<script type="text/javascript" src="js/lib/mousewheel.js"></script>
<script type="text/javascript" src="js/eyedropper.js"></script>
<!--<script type="text/javascript" src="js/grid.js"></script>-->
<script type="text/javascript" src="js/lib/requestanimationframe.js"></script>
<script type="text/javascript" src="js/lib/taphold.js"></script>
<script type="text/javascript" src="js/lib/filesaver.js"></script>
<script type="text/javascript" src="js/paste.js"></script>
<script type="text/javascript" src="js/start.js"></script>
<!-- endbuild -->
</body>
</html>