-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgulpfile.js
More file actions
77 lines (67 loc) · 1.74 KB
/
Copy pathgulpfile.js
File metadata and controls
77 lines (67 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
var util = require('@synesthesia-project/gulp-util');
var gulp = require('gulp');
var webpack = require('webpack');
util.cleanTask(['.tmp', 'dist']);
gulp.task("copy-js", function(){
return gulp.src("./src/scripts/js/*.js")
.pipe(gulp.dest('.tmp/scripts'))
});
util.typescriptTasks({
prefix: 'main-',
tsconfig: 'src/scripts/ts/tsconfig.json',
sourcemap: true,
sourcemapSourceRoot: 'src/scripts/ts',
outputDir: '.tmp/scripts',
lintSrc: ['src/scripts/ts/**/*.ts', 'src/scripts/ts/**/*.tsx']
});
util.typescriptTasks({
prefix: 'integration-',
tsconfig: 'src/integration/tsconfig.json',
outputDir: 'dist/integration',
lintSrc: ['src/integration/**/*.ts']
});
gulp.task('lint', gulp.parallel('main-lint', 'integration-lint'));
gulp.task('lint:fix', gulp.parallel('main-lint:fix', 'integration-lint:fix'));
util.webpackTask('webpack', {
entry: {
bundle: "./.tmp/scripts/main.js",
auth_callback: "./.tmp/scripts/auth_callback.js",
},
output: {
filename: "[name].js",
path: __dirname + "/dist"
},
mode: 'development',
devtool: 'source-map',
module: {
rules: [
{
test: /\.js$/,
use: ["source-map-loader"],
enforce: "pre"
}
]
},
plugins: [
new webpack.IgnorePlugin({ resourceRegExp: /perf_hooks/ })
]
});
gulp.task('css', function () {
return gulp.src('./src/styles/**/*.css').pipe(gulp.dest('dist/styles'));
});
gulp.task("dist", gulp.series(
gulp.parallel(
gulp.series(
'integration-ts',
gulp.parallel('main-ts', 'copy-js'), 'webpack'),
'css',
),
function(){
return gulp.src([
'./src/index.html',
'./src/auth.html'
])
.pipe(gulp.dest('dist'));
}
));
gulp.task('default', gulp.series('clean', 'dist'));