-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathjust.config.js
43 lines (35 loc) · 1.26 KB
/
just.config.js
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
// @ts-check
const { task, series, parallel, option, argv, tscTask, cleanTask, eslintTask, prettierTask, prettierCheckTask } = require('just-scripts');
const path = require('path');
const srcPath = path.join(process.cwd(), 'src');
const libPath = path.join(process.cwd(), 'lib');
const checkPublishing = () => {
const { checkPublishingTask } = require('./lib/tasks/checkPublishingTask');
return checkPublishingTask();
};
const checkForModifiedFiles = () => {
const { checkForModifiedFiles } = require('./lib/tasks/checkForModifiedFilesTask');
return checkForModifiedFiles();
};
module.exports = function preset() {
option('production');
task(
'ts',
tscTask({
pretty: true,
allowJs: true,
target: 'es6',
outDir: 'lib',
module: 'commonjs',
...(argv().production && { inlineSources: true, sourceRoot: path.relative(libPath, srcPath) }),
}),
);
task('depcheck', checkPublishing);
task('lint', eslintTask({ files: ['src/'] }));
task('prettier', () => (argv().fix ? prettierTask : prettierCheckTask));
task('cleanlib', cleanTask([libPath]));
task('checkForModifiedFiles', checkForModifiedFiles);
task('build', series('cleanlib', parallel('lint', 'ts')));
task('no-op', () => {});
task('clean', 'no-op');
};