File tree Expand file tree Collapse file tree 6 files changed +97
-70
lines changed Expand file tree Collapse file tree 6 files changed +97
-70
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ gulp.task('build', function () {
2121 . pipe ( webpack ( {
2222 config : [
2323 require ( './support/webpack.config.js' ) ,
24- require ( './support/webpack.config.slim.js' )
24+ require ( './support/webpack.config.dev.js' ) ,
25+ require ( './support/webpack.config.slim.js' ) ,
26+ require ( './support/webpack.config.slim.dev.js' )
2527 ]
2628 } ) )
2729 . pipe ( gulp . dest ( BUILD_TARGET_DIR ) ) ;
Original file line number Diff line number Diff line change 5151 "socket.io" : " 2.0.4" ,
5252 "strip-loader" : " 0.1.2" ,
5353 "text-blob-builder" : " 0.0.1" ,
54+ "webpack-merge" : " 4.1.2" ,
5455 "webpack-stream" : " 3.2.0" ,
5556 "zuul" : " ^3.11.1 " ,
5657 "zuul-builder-webpack" : " ^1.2.0" ,
Original file line number Diff line number Diff line change 1+
2+ var webpack = require ( 'webpack' ) ;
3+
4+ module . exports = {
5+ name : 'default' ,
6+ entry : './lib/index.js' ,
7+ output : {
8+ library : 'io' ,
9+ libraryTarget : 'umd' ,
10+ filename : 'socket.io.dev.js'
11+ } ,
12+ externals : {
13+ global : glob ( )
14+ } ,
15+ devtool : 'source-map' ,
16+ module : {
17+ loaders : [ {
18+ test : / \. j s $ / ,
19+ exclude : / ( n o d e _ m o d u l e s | b o w e r _ c o m p o n e n t s ) / ,
20+ loader : 'babel' , // 'babel-loader' is also a legal name to reference
21+ query : { presets : [ 'es2015' ] }
22+ } , {
23+ test : / \j s o n 3 .j s / ,
24+ loader : 'imports?define=>false'
25+ } ]
26+ }
27+ } ;
28+
29+ /**
30+ * Populates `global`.
31+ *
32+ * @api private
33+ */
34+
35+ function glob ( ) {
36+ return 'typeof self !== "undefined" ? self : ' +
37+ 'typeof window !== "undefined" ? window : ' +
38+ 'typeof global !== "undefined" ? global : {}' ;
39+ }
Original file line number Diff line number Diff line change 1-
21var webpack = require ( 'webpack' ) ;
2+ var merge = require ( 'webpack-merge' ) ;
3+ var baseConfig = require ( './webpack.config.dev.js' )
34
4- module . exports = {
5- name : 'default' ,
6- entry : './lib/index.js' ,
5+ module . exports = merge ( baseConfig , {
76 output : {
87 library : 'io' ,
98 libraryTarget : 'umd' ,
109 filename : 'socket.io.js'
1110 } ,
12- externals : {
13- global : glob ( )
14- } ,
15- devtool : 'source-map' ,
1611 plugins : [
1712 new webpack . optimize . UglifyJsPlugin ( {
1813 compress : {
@@ -27,27 +22,4 @@ module.exports = {
2722 }
2823 } )
2924 ] ,
30- module : {
31- loaders : [ {
32- test : / \. j s $ / ,
33- exclude : / ( n o d e _ m o d u l e s | b o w e r _ c o m p o n e n t s ) / ,
34- loader : 'babel' , // 'babel-loader' is also a legal name to reference
35- query : { presets : [ 'es2015' ] }
36- } , {
37- test : / \j s o n 3 .j s / ,
38- loader : 'imports?define=>false'
39- } ]
40- }
41- } ;
42-
43- /**
44- * Populates `global`.
45- *
46- * @api private
47- */
48-
49- function glob ( ) {
50- return 'typeof self !== "undefined" ? self : ' +
51- 'typeof window !== "undefined" ? window : ' +
52- 'typeof global !== "undefined" ? global : {}' ;
53- }
25+ } ) ;
Original file line number Diff line number Diff line change 1+
2+ var webpack = require ( 'webpack' ) ;
3+
4+ module . exports = {
5+ name : 'slim' ,
6+ entry : './lib/index.js' ,
7+ output : {
8+ library : 'io' ,
9+ libraryTarget : 'umd' ,
10+ filename : 'socket.io.slim.dev.js'
11+ } ,
12+ externals : {
13+ global : glob ( ) ,
14+ json3 : 'JSON'
15+ } ,
16+ devtool : 'source-map' ,
17+ plugins : [
18+ new webpack . NormalModuleReplacementPlugin ( / d e b u g / , process . cwd ( ) + '/support/noop.js' ) ,
19+ ] ,
20+ module : {
21+ loaders : [ {
22+ test : / \. j s $ / ,
23+ exclude : / ( n o d e _ m o d u l e s | b o w e r _ c o m p o n e n t s ) / ,
24+ loader : 'babel' , // 'babel-loader' is also a legal name to reference
25+ query : { presets : [ 'es2015' ] }
26+ } , {
27+ test : / \j s o n 3 .j s / ,
28+ loader : 'imports?define=>false'
29+ } , {
30+ test : / \. j s $ / ,
31+ loader : 'strip-loader?strip[]=debug'
32+ } ]
33+ }
34+ } ;
35+
36+ /**
37+ * Populates `global`.
38+ *
39+ * @api private
40+ */
41+
42+ function glob ( ) {
43+ return 'typeof self !== "undefined" ? self : ' +
44+ 'typeof window !== "undefined" ? window : ' +
45+ 'typeof global !== "undefined" ? global : {}' ;
46+ }
Original file line number Diff line number Diff line change 1-
21var webpack = require ( 'webpack' ) ;
2+ var merge = require ( 'webpack-merge' ) ;
3+ var baseConfig = require ( './webpack.config.slim.dev.js' )
34
4- module . exports = {
5- name : 'slim' ,
6- entry : './lib/index.js' ,
5+ module . exports = merge ( baseConfig , {
76 output : {
87 library : 'io' ,
98 libraryTarget : 'umd' ,
109 filename : 'socket.io.slim.js'
1110 } ,
12- externals : {
13- global : glob ( ) ,
14- json3 : 'JSON'
15- } ,
16- devtool : 'source-map' ,
1711 plugins : [
18- new webpack . NormalModuleReplacementPlugin ( / d e b u g / , process . cwd ( ) + '/support/noop.js' ) ,
1912 new webpack . optimize . UglifyJsPlugin ( )
2013 ] ,
21- module : {
22- loaders : [ {
23- test : / \. j s $ / ,
24- exclude : / ( n o d e _ m o d u l e s | b o w e r _ c o m p o n e n t s ) / ,
25- loader : 'babel' , // 'babel-loader' is also a legal name to reference
26- query : { presets : [ 'es2015' ] }
27- } , {
28- test : / \j s o n 3 .j s / ,
29- loader : 'imports?define=>false'
30- } , {
31- test : / \. j s $ / ,
32- loader : 'strip-loader?strip[]=debug'
33- } ]
34- }
35- } ;
36-
37- /**
38- * Populates `global`.
39- *
40- * @api private
41- */
42-
43- function glob ( ) {
44- return 'typeof self !== "undefined" ? self : ' +
45- 'typeof window !== "undefined" ? window : ' +
46- 'typeof global !== "undefined" ? global : {}' ;
47- }
14+ } ) ;
You can’t perform that action at this time.
0 commit comments