Skip to content

Commit

Permalink
[chore] Restore unminified distribution files (#1191)
Browse files Browse the repository at this point in the history
  • Loading branch information
atogata authored and darrachequesne committed Mar 1, 2018
1 parent bb743c4 commit e27f38b
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 70 deletions.
4 changes: 3 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ gulp.task('build', function () {
.pipe(webpack({
config: [
require('./support/webpack.config.js'),
require('./support/webpack.config.slim.js')
require('./support/webpack.config.dev.js'),
require('./support/webpack.config.slim.js'),
require('./support/webpack.config.slim.dev.js')
]
}))
.pipe(gulp.dest(BUILD_TARGET_DIR));
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"socket.io": "2.0.4",
"strip-loader": "0.1.2",
"text-blob-builder": "0.0.1",
"webpack-merge": "4.1.2",
"webpack-stream": "3.2.0",
"zuul": "^3.11.1 ",
"zuul-builder-webpack": "^1.2.0",
Expand Down
39 changes: 39 additions & 0 deletions support/webpack.config.dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

var webpack = require('webpack');

module.exports = {
name: 'default',
entry: './lib/index.js',
output: {
library: 'io',
libraryTarget: 'umd',
filename: 'socket.io.dev.js'
},
externals: {
global: glob()
},
devtool: 'source-map',
module: {
loaders: [{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel', // 'babel-loader' is also a legal name to reference
query: { presets: ['es2015'] }
}, {
test: /\json3.js/,
loader: 'imports?define=>false'
}]
}
};

/**
* Populates `global`.
*
* @api private
*/

function glob () {
return 'typeof self !== "undefined" ? self : ' +
'typeof window !== "undefined" ? window : ' +
'typeof global !== "undefined" ? global : {}';
}
36 changes: 4 additions & 32 deletions support/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@

var webpack = require('webpack');
var merge = require('webpack-merge');
var baseConfig = require('./webpack.config.dev.js')

module.exports = {
name: 'default',
entry: './lib/index.js',
module.exports = merge(baseConfig, {
output: {
library: 'io',
libraryTarget: 'umd',
filename: 'socket.io.js'
},
externals: {
global: glob()
},
devtool: 'source-map',
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: {
Expand All @@ -27,27 +22,4 @@ module.exports = {
}
})
],
module: {
loaders: [{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel', // 'babel-loader' is also a legal name to reference
query: { presets: ['es2015'] }
}, {
test: /\json3.js/,
loader: 'imports?define=>false'
}]
}
};

/**
* Populates `global`.
*
* @api private
*/

function glob () {
return 'typeof self !== "undefined" ? self : ' +
'typeof window !== "undefined" ? window : ' +
'typeof global !== "undefined" ? global : {}';
}
});
46 changes: 46 additions & 0 deletions support/webpack.config.slim.dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

var webpack = require('webpack');

module.exports = {
name: 'slim',
entry: './lib/index.js',
output: {
library: 'io',
libraryTarget: 'umd',
filename: 'socket.io.slim.dev.js'
},
externals: {
global: glob(),
json3: 'JSON'
},
devtool: 'source-map',
plugins: [
new webpack.NormalModuleReplacementPlugin(/debug/, process.cwd() + '/support/noop.js'),
],
module: {
loaders: [{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel', // 'babel-loader' is also a legal name to reference
query: { presets: ['es2015'] }
}, {
test: /\json3.js/,
loader: 'imports?define=>false'
}, {
test: /\.js$/,
loader: 'strip-loader?strip[]=debug'
}]
}
};

/**
* Populates `global`.
*
* @api private
*/

function glob () {
return 'typeof self !== "undefined" ? self : ' +
'typeof window !== "undefined" ? window : ' +
'typeof global !== "undefined" ? global : {}';
}
41 changes: 4 additions & 37 deletions support/webpack.config.slim.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,14 @@

var webpack = require('webpack');
var merge = require('webpack-merge');
var baseConfig = require('./webpack.config.slim.dev.js')

module.exports = {
name: 'slim',
entry: './lib/index.js',
module.exports = merge(baseConfig, {
output: {
library: 'io',
libraryTarget: 'umd',
filename: 'socket.io.slim.js'
},
externals: {
global: glob(),
json3: 'JSON'
},
devtool: 'source-map',
plugins: [
new webpack.NormalModuleReplacementPlugin(/debug/, process.cwd() + '/support/noop.js'),
new webpack.optimize.UglifyJsPlugin()
],
module: {
loaders: [{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel', // 'babel-loader' is also a legal name to reference
query: { presets: ['es2015'] }
}, {
test: /\json3.js/,
loader: 'imports?define=>false'
}, {
test: /\.js$/,
loader: 'strip-loader?strip[]=debug'
}]
}
};

/**
* Populates `global`.
*
* @api private
*/

function glob () {
return 'typeof self !== "undefined" ? self : ' +
'typeof window !== "undefined" ? window : ' +
'typeof global !== "undefined" ? global : {}';
}
});

0 comments on commit e27f38b

Please sign in to comment.