mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
build(@nestjs) fix gulpfile configuration
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,6 +8,7 @@ package-lock.json
|
|||||||
/.vscode
|
/.vscode
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
|
.DS_Store
|
||||||
lerna-debug.log
|
lerna-debug.log
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
|
|||||||
20
gulpfile.js
20
gulpfile.js
@@ -7,14 +7,14 @@ const sourcemaps = require('gulp-sourcemaps');
|
|||||||
const clean = require('gulp-clean');
|
const clean = require('gulp-clean');
|
||||||
|
|
||||||
const packages = {
|
const packages = {
|
||||||
common: ts.createProject('src/common/tsconfig.json'),
|
common: ts.createProject('packages/common/tsconfig.json'),
|
||||||
core: ts.createProject('src/core/tsconfig.json'),
|
core: ts.createProject('packages/core/tsconfig.json'),
|
||||||
microservices: ts.createProject('src/microservices/tsconfig.json'),
|
microservices: ts.createProject('packages/microservices/tsconfig.json'),
|
||||||
websockets: ts.createProject('src/websockets/tsconfig.json'),
|
websockets: ts.createProject('packages/websockets/tsconfig.json'),
|
||||||
testing: ts.createProject('src/testing/tsconfig.json'),
|
testing: ts.createProject('packages/testing/tsconfig.json'),
|
||||||
};
|
};
|
||||||
const modules = Object.keys(packages);
|
const modules = Object.keys(packages);
|
||||||
const source = 'src';
|
const source = 'packages';
|
||||||
const distId = process.argv.indexOf('--dist');
|
const distId = process.argv.indexOf('--dist');
|
||||||
const dist = distId < 0 ? 'node_modules/@nestjs' : process.argv[distId + 1];
|
const dist = distId < 0 ? 'node_modules/@nestjs' : process.argv[distId + 1];
|
||||||
|
|
||||||
@@ -28,12 +28,12 @@ gulp.task('default', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('copy:ts', function() {
|
gulp.task('copy:ts', function() {
|
||||||
return gulp.src(['src/**/*.ts']).pipe(gulp.dest('./lib'));
|
return gulp.packages(['packages/**/*.ts']).pipe(gulp.dest('./bundle'));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('clean:lib', function() {
|
gulp.task('clean:bundle', function() {
|
||||||
return gulp
|
return gulp
|
||||||
.src(['lib/**/*.js.map', 'lib/**/*.ts', '!lib/**/*.d.ts'], { read: false })
|
.packages(['bundle/**/*.js.map', 'bundle/**/*.ts', '!bundle/**/*.d.ts'], { read: false })
|
||||||
.pipe(clean());
|
.pipe(clean());
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ gulp.task('move', function() {
|
|||||||
const directories = examplesDirs.concat(integrationDirs);
|
const directories = examplesDirs.concat(integrationDirs);
|
||||||
|
|
||||||
let stream = gulp
|
let stream = gulp
|
||||||
.src(['node_modules/@nestjs/**/*']);
|
.packages(['node_modules/@nestjs/**/*']);
|
||||||
|
|
||||||
directories.forEach((dir) => {
|
directories.forEach((dir) => {
|
||||||
stream = stream.pipe(gulp.dest(dir + '/node_modules/@nestjs'));
|
stream = stream.pipe(gulp.dest(dir + '/node_modules/@nestjs'));
|
||||||
|
|||||||
Reference in New Issue
Block a user