|
1 | | -// const gulp = require('gulp'); |
2 | | -// const rename = require('gulp-rename'); |
3 | | -// const babel = require("gulp-babel"); |
4 | | -// const webpack = require('gulp-webpack'); |
5 | | -// const webpackConfig = require('./webpack.config.demo.prod.js'); |
6 | | -// const sass = require('gulp-sass'); |
7 | | -// |
8 | | -// gulp.task('build_styles', function () { |
9 | | -// return gulp.src('./src/styles/*.scss') |
10 | | -// .pipe(sass().on('error', sass.logError)) |
11 | | -// .pipe(gulp.dest('./lib/styles')); |
12 | | -// }); |
13 | | -// |
14 | | -// // library |
15 | | -// gulp.task('copy_styles', function () { |
16 | | -// return gulp.src('./src/styles/!**!/!*') |
17 | | -// .pipe(gulp.dest('./lib/styles')); |
18 | | -// }); |
19 | | -// |
20 | | -// gulp.task('build', ['copy_styles', 'build_styles'], function () { |
21 | | -// return gulp.src("./src/!**/!*.js") |
22 | | -// .pipe(babel()) |
23 | | -// .pipe(gulp.dest("./lib")); |
24 | | -// }); |
25 | | -// |
26 | | -// // demo |
27 | | -// // removes the output configuration from the webpack.config.js file, otherwise it doesn't work. |
28 | | -// webpackConfig.output.path = null; |
29 | | -// |
30 | | -// gulp.task('copy-index', function () { |
31 | | -// return gulp.src('./demo/index.prod.html') |
32 | | -// .pipe(rename('index.html')) |
33 | | -// .pipe(gulp.dest('./docs')); |
34 | | -// }); |
35 | | -// |
36 | | -// gulp.task('build-demo', ['copy-index'], function () { |
37 | | -// return gulp.src("./demo/client.tsx") |
38 | | -// .pipe(webpack(webpackConfig)) |
39 | | -// .pipe(gulp.dest('./docs')); |
40 | | -// }); |
| 1 | +const gulp = require('gulp'); |
| 2 | +const rename = require('gulp-rename'); |
| 3 | +const babel = require("gulp-babel"); |
| 4 | +const webpack = require('gulp-webpack'); |
| 5 | +const ts = require('gulp-typescript'); |
| 6 | +const webpackConfig = require('./webpack.config.demo.prod.js'); |
| 7 | +const sass = require('gulp-sass'); |
| 8 | + |
| 9 | +gulp.task('build_styles', function () { |
| 10 | + return gulp.src('./src/styles/*.scss') |
| 11 | + .pipe(sass().on('error', sass.logError)) |
| 12 | + .pipe(gulp.dest('./lib/styles')); |
| 13 | +}); |
| 14 | + |
| 15 | +// library |
| 16 | +gulp.task('copy_styles', function () { |
| 17 | + return gulp.src('./src/styles/!**!/!*') |
| 18 | + .pipe(gulp.dest('./lib/styles')); |
| 19 | +}); |
| 20 | + |
| 21 | +gulp.task('build', ['copy_styles', 'build_styles'], function () { |
| 22 | + return gulp.src('src/**/*.ts') |
| 23 | + .pipe(ts({ |
| 24 | + noImplicitAny: true, |
| 25 | + outFile: 'reactMde.js' |
| 26 | + })) |
| 27 | + .pipe(gulp.dest('./lib')); |
| 28 | +}); |
| 29 | + |
| 30 | +// demo |
| 31 | +// removes the output configuration from the webpack.config.js file, otherwise it doesn't work. |
| 32 | +webpackConfig.output.path = null; |
| 33 | + |
| 34 | +gulp.task('copy-index', function () { |
| 35 | + return gulp.src('./demo/index.prod.html') |
| 36 | + .pipe(rename('index.html')) |
| 37 | + .pipe(gulp.dest('./docs')); |
| 38 | +}); |
| 39 | + |
| 40 | +gulp.task('build-demo', ['copy-index'], function () { |
| 41 | + return gulp.src("./demo/client.tsx") |
| 42 | + .pipe(webpack(webpackConfig)) |
| 43 | + .pipe(gulp.dest('./docs')); |
| 44 | +}); |
0 commit comments