build: modularize the gulp file to be easier to maintain (#14259)
This is a precursor to bringing in some of the gulp tasks from angular.io, which could lead to the gulpfile becoming unwieldy.
This commit is contained in:

committed by
Igor Minar

parent
a9096437fd
commit
0ba5bebf61
33
tools/gulp-tasks/serve.js
Normal file
33
tools/gulp-tasks/serve.js
Normal file
@ -0,0 +1,33 @@
|
||||
module.exports = {
|
||||
|
||||
// Serve the built files
|
||||
default: (gulp) => () => {
|
||||
const connect = require('gulp-connect');
|
||||
const cors = require('cors');
|
||||
const path = require('path');
|
||||
|
||||
connect.server({
|
||||
root: path.resolve(__dirname, '../../dist'),
|
||||
port: 8000,
|
||||
livereload: false,
|
||||
open: false,
|
||||
middleware: (connect, opt) => [cors()],
|
||||
});
|
||||
},
|
||||
|
||||
// Serve the examples
|
||||
examples: (gulp) => () => {
|
||||
const connect = require('gulp-connect');
|
||||
const cors = require('cors');
|
||||
const path = require('path');
|
||||
|
||||
connect.server({
|
||||
root: path.resolve(__dirname, '../../dist/examples'),
|
||||
port: 8001,
|
||||
livereload: false,
|
||||
open: false,
|
||||
middleware: (connect, opt) => [cors()],
|
||||
});
|
||||
}
|
||||
|
||||
};
|
Reference in New Issue
Block a user