Skip to content

Commit

Permalink
feat: stop transpiling and use uglify-harmony
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Oct 27, 2016
1 parent 7af165f commit a83f8dd
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 47 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ Your `package.json` should have the following entries.

To bring you its many benefits, `aegir` requires

- [ES6 / Babel](https://github.com/babel/babel) transpilation
- JS written in [Standard](https://github.com/feross/standard) style
- Tests written in [Mocha](https://github.com/mochajs/mocha)
- [Karma](https://github.com/karma-runner/karma) for browser tests
Expand Down
5 changes: 0 additions & 5 deletions config/babel.js

This file was deleted.

4 changes: 1 addition & 3 deletions config/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict'

const path = require('path')
const webpackConfig = require('./webpack')
const timeout = require('./custom').timeout

Expand Down Expand Up @@ -63,7 +62,7 @@ let browsers = []
if (process.env.TRAVIS) {
if (process.env.SAUCE_USERNAME) {
browsers = Object.keys(launchers)
concurrency = 2
concurrency = 3
reporters = ['progress', 'saucelabs']
} else {
browsers.push('Firefox')
Expand All @@ -82,7 +81,6 @@ module.exports = function (config) {
}
},
files: [
path.join(require.resolve('babel-polyfill'), '/../../dist/polyfill.js'),
'test/browser.js',
'test/**/*.spec.js'
],
Expand Down
16 changes: 3 additions & 13 deletions config/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ const path = require('path')
const upperFirst = require('lodash.upperfirst')
const camelCase = require('lodash.camelcase')
const merge = require('webpack-merge')
const webpack = require('webpack')

const pkg = require(path.resolve('package.json'))
let customConfig = {}
try {
customConfig = require(path.resolve('.aegir.js'))
} catch (err) {
}
const babel = require('./babel')

// e.g. peer-id -> PeerId
const libraryName = upperFirst(camelCase(pkg.name))
Expand All @@ -31,7 +31,6 @@ const specific = merge(custom1, custom2)

const shared = {
entry: [
require.resolve('babel-polyfill'),
path.resolve('src/index.js')
],
output: {
Expand All @@ -53,24 +52,15 @@ const shared = {
},
module: {
loaders: [{
test: /\.js$/,
exclude: /node_modules|vendor/,
loader: 'babel',
query: babel
}, {
test: /\.js$/,
include: /node_modules\/(hoek|qs|wreck|boom|ipfs|promisify-es|whatwg-fetch|node-fetch|isomorphic-fetch|db\.js)/,
loader: 'babel',
query: babel
}, {
test: /\.json$/,
loader: 'json'
}]
},
node: {
Buffer: true
},
plugins: []
plugins: [],
target: 'web'
}

const dev = merge(shared, {
Expand Down
27 changes: 11 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
},
"keywords": [
"webpack",
"babel",
"standard",
"lint",
"build"
Expand All @@ -25,25 +24,19 @@
"license": "MIT",
"dependencies": {
"args-parser": "^1.0.2",
"babel-core": "^6.14.0",
"babel-loader": "^6.2.5",
"babel-polyfill": "^6.13.0",
"babel-preset-es2015": "^6.14.0",
"brfs": "^1.4.3",
"chalk": "^1.1.3",
"conventional-github-releaser": "^1.1.3",
"coveralls": "^2.11.14",
"eslint": "^3.6.0",
"eslint-config-standard": "^6.1.0",
"eslint-plugin-promise": "^3.0.0",
"eslint-plugin-standard": "^2.0.0",
"eslint": "^3.8.1",
"eslint-config-standard": "^6.2.1",
"eslint-plugin-promise": "^3.3.0",
"eslint-plugin-standard": "^2.0.1",
"gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
"gulp-bump": "^2.4.0",
"gulp-conventional-changelog": "^1.1.0",
"gulp-eslint": "^3.0.1",
"gulp-filter": "^4.0.0",
"gulp-git": "^1.11.3",
"gulp-git": "^1.12.0",
"gulp-mocha": "^3.0.1",
"gulp-rename": "^1.2.2",
"gulp-size": "^2.1.0",
Expand All @@ -57,31 +50,33 @@
"karma": "^1.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-firefox-launcher": "^1.0.0",
"karma-mocha": "^1.1.1",
"karma-mocha": "^1.2.0",
"karma-mocha-own-reporter": "^1.1.2",
"karma-sauce-launcher": "^1.1.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^1.8.0",
"lodash.camelcase": "^4.3.0",
"lodash.includes": "^4.3.0",
"lodash.upperfirst": "^4.3.1",
"mocha": "^3.0.2",
"mocha": "^3.1.2",
"pretty-hrtime": "^1.0.2",
"pump": "^1.0.1",
"rimraf": "^2.5.4",
"run-sequence": "^1.2.2",
"semver": "^5.3.0",
"signal-exit": "^3.0.1",
"stream-http": "^2.4.0",
"transform-loader": "^0.2.3",
"uglify-js": "github:mishoo/UglifyJS2#harmony",
"webpack": "^2.1.0-beta.25",
"webpack-merge": "^0.14.1"
"webpack-merge": "^0.15.0"
},
"repository": {
"type": "git",
"url": "https://github.com/dignifiedquire/aegir"
},
"engines": {
"node": ">=4.2.2"
"node": ">=4.0.0"
},
"contributors": [
"David Dias <daviddias.p@gmail.com>",
Expand Down
21 changes: 12 additions & 9 deletions tasks/build/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
module.exports = (gulp) => {
gulp.task('build:browser', ['clean:browser'], (done) => {
const webpack = require('webpack')
const uglify = require('gulp-uglify')
const minifier = require('gulp-uglify/minifier')
const util = require('gulp-util')
const size = require('gulp-size')
const rename = require('gulp-rename')
const uglify = require('uglify-js')
const pump = require('pump')

const config = require('../../config/webpack')

Expand All @@ -18,16 +20,17 @@ module.exports = (gulp) => {
)

webpack(c, webpackDone(() => {
gulp.src('dist/index.js')
.pipe(uglify({
pump([
gulp.src('dist/index.js'),
minifier({
mangle: false
}))
.pipe(rename({
}, uglify),
rename({
suffix: '.min'
}))
.pipe(size())
.pipe(gulp.dest('dist'))
.once('end', done)
}),
size(),
gulp.dest('dist')
], done)
}))

function webpackDone (done) {
Expand Down

0 comments on commit a83f8dd

Please sign in to comment.