Skip to content

Commit f6514f7

Browse files
committed
Updating dependencies to not use peer deps.
1 parent 82ea2ad commit f6514f7

File tree

5 files changed

+18
-105
lines changed

5 files changed

+18
-105
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
node_modules
22
.DS_Store
33
npm*.log
4+
coverage
5+
temp
46
lib
7+
dist

gulpfile.js

Lines changed: 2 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,5 @@
11
'use strict';
22

3-
let gulp = require('gulp');
3+
let build = require('node-library-build');
44

5-
let config = {
6-
paths: {
7-
libFolder: 'lib',
8-
sourceMatch: [
9-
'src/**/*.ts',
10-
'typings/tsd.d.ts'
11-
],
12-
testMatch: [
13-
'lib/**/*.test.js'
14-
]
15-
}
16-
}
17-
18-
gulp.task('build', () => {
19-
let ts = require('gulp-typescript');
20-
let plumber = require('gulp-plumber');
21-
let merge = require('merge2');
22-
let lint = require('gulp-tslint');
23-
let tsConfig = require('./tsconfig.json');
24-
let paths = config.paths;
25-
let errorCount = 0;
26-
let allStreams = [];
27-
let tsProject = ts.createProject(tsConfig.compilerOptions);
28-
let gutil = require('gulp-util');
29-
let sourceStream = gulp.src(paths.sourceMatch);
30-
31-
sourceStream
32-
.pipe(lint({
33-
configuration: require('./tslint.json')
34-
}))
35-
.pipe(lint.report('full', {
36-
emitError: false
37-
}));
38-
39-
let tsResult = sourceStream
40-
.pipe(plumber({
41-
errorHandler: function(error) {
42-
// console.log(error);
43-
errorCount++;
44-
}
45-
}))
46-
.pipe(ts(tsProject, undefined, ts.reporter.longReporter()));
47-
48-
allStreams.push(tsResult.js.pipe(gulp.dest(paths.libFolder)));
49-
allStreams.push(tsResult.dts.pipe(gulp.dest(paths.libFolder)));
50-
51-
let mergedStream = merge(allStreams);
52-
53-
mergedStream.on('queueDrain', function() {
54-
if (errorCount) {
55-
// throw new gutil.PluginError('msg', `[gulp-typescript] TypeScript error(s): ${ chalk.red(errorCount) }`, { showStack: false });
56-
}
57-
});
58-
59-
return mergedStream;
60-
});
61-
62-
gulp.task('test', ['build'], () => {
63-
let mocha = require('gulp-mocha');
64-
65-
return gulp.src(config.paths.testMatch, { read: false })
66-
.pipe(mocha());
67-
});
68-
69-
gulp.task('default', ['build']);
5+
build.initialize(require('gulp'));

package.json

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
11
{
22
"name": "gulp-core-build-webpack",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",
77
"license": "MIT",
8-
"peerDependencies": {
9-
"webpack": "^1.12.14"
10-
},
118
"dependencies": {
12-
"gulp-core-build": "^0.4.0",
9+
"gulp-core-build": "^0.4.4",
1310
"gulp": "^3.9.1",
14-
"gulp-util": "^3.0.7"
11+
"gulp-util": "^3.0.7",
12+
"webpack": "^1.12.14"
1513
},
1614
"devDependencies": {
17-
"gulp-plumber": "^1.1.0",
18-
"gulp-tslint": "^4.3.3",
19-
"gulp-typescript": "^2.12.1",
20-
"merge2": "^1.0.1",
21-
"tslint": "^3.5.0",
22-
"typescript": "^1.8.7"
15+
"node-library-build": "^0.0.3"
2316
}
2417
}

src/WebpackTask.ts

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ export class WebpackTask extends GulpTask<IWebpackConfig> {
1111
configPath: './webpack.config.js'
1212
};
1313

14+
public resources = {
15+
webpack: require('webpack')
16+
};
17+
1418
public executeTask(gulp, completeCallback): any {
15-
// let isProduction = (process.argv.indexOf('--production') > -1);
16-
// let streams = [];
1719
let shouldInitWebpack = (process.argv.indexOf('--initwebpack') > -1);
1820
let path = require('path');
1921

@@ -72,30 +74,6 @@ export class WebpackTask extends GulpTask<IWebpackConfig> {
7274
`took ${gutil.colors.magenta(duration)} ms.`)
7375
)); // end file
7476

75-
/*
76-
77-
let chunkStats = {
78-
chunk: chunk,
79-
modules: null
80-
};
81-
let statsPath = path.join(outputDir, chunk.files[0]) + '.stats.json';
82-
83-
if (child.modules) {
84-
chunkStats.modules = statsResult.modules
85-
.filter(mod => (mod.chunks && mod.chunks.indexOf(chunk.id) > -1))
86-
.map(mod => ({ name: mod.name, size: mod.size }))
87-
.sort((a, b) => (a.size < b.size ? 1 : -1));
88-
}
89-
90-
let fs = require('fs');
91-
92-
fs.writeFileSync(
93-
statsPath,
94-
JSON.stringify(chunkStats, null, 2),
95-
'utf8'
96-
);
97-
*/
98-
9977
}); // end chunk
10078

10179
}); // end child

webpack.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
'use strict';
22

3-
let webpack = require('webpack');
3+
/** Note: this require may need to be fixed to point to the build that exports the gulp-core-build-webpack instance. */
4+
let webpackTaskResources = require('web-library-build').webpack.resources;
5+
let webpack = webpackTaskResources.webpack;
6+
47
let path = require('path');
58
let isProduction = process.argv.indexOf('--production') > -1;
69
let packageJSON = require('./package.json');

0 commit comments

Comments
 (0)