Initial structure

pull/1/head
Trivernis 5 years ago
parent 539835d064
commit aaae2499dd

7
.gitignore vendored

@ -0,0 +1,7 @@
.nyc_output/
coverage/
node_modules/
npm-debug.log
test/*.log
dist
.idea

@ -0,0 +1,42 @@
const {src, dest, watch, series, task} = require('gulp');
const sass = require('gulp-sass');
const ts = require('gulp-typescript');
const minify = require('gulp-minify');
const del = require('delete');
function clearDist(cb) {
del('dist/*', cb);
}
function compileTypescript() {
let tsProject = ts.createProject('tsconfig.json');
let tsResult = tsProject.src().pipe(tsProject());
return tsResult
//.pipe(minify())
.pipe(dest('dist'));
}
function minifyJs() {
return src('src/public/javascripts/**/*.js')
.pipe(minify({
ext: {
src: '-debug.js',
min: '.js'
}
}))
.pipe(dest('dist/public/javascripts'));
}
function compileSass() {
return src('src/public/stylesheets/sass/**/style.sass')
.pipe(sass().on('error', sass.logError))
.pipe(dest('dist/public/stylesheets'));
}
task('default', series(clearDist, compileTypescript, minifyJs, compileSass));
task('watch', () => {
watch('src/public/stylesheets/sass/**/*.sass', compileSass);
watch('**/*.js', minifyJs);
watch('**/*.ts', compileTypescript);
});

@ -0,0 +1,21 @@
{
"compileOnSave": true,
"compilerOptions": {
"noImplicitAny": true,
"removeComments": true,
"preserveConstEnums": true,
"outDir": "./dist",
"sourceMap": true,
"target": "es2018",
"allowJs": true,
"moduleResolution": "node",
"module": "commonjs"
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"**/*.spec.ts"
]
}
Loading…
Cancel
Save