Skip to content

Commit

Permalink
Merge pull request #19 from maniator/rollup
Browse files Browse the repository at this point in the history
Use rollup instead of webpack for bundling the library
  • Loading branch information
maniator authored May 10, 2017
2 parents 4f33b28 + 5da856d commit e600c15
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 78 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
npm-debug.log
node_modules
dist
lib
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.idea
npm-debug.log
node_modules
example
config
release.js
_config.yml
.npmignore
.gitignore
rollup.config.js
5 changes: 0 additions & 5 deletions config/helpers.js

This file was deleted.

63 changes: 0 additions & 63 deletions config/webpack.common.js

This file was deleted.

21 changes: 14 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
"name": "servable",
"version": "0.2.0",
"description": "From scratch observable",
"main": "dist/index.js",
"main": "lib/index.js",
"module": "src/index.js",
"jsnext:main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 0",
"build": "rm -rf dist && webpack --config config/webpack.common.js",
"build": "rimraf lib dist && buba src -o lib && rollup -c && uglifyjs dist/index.js -c \"warnings=false\" --comments -m -o dist/index.min.js --verbose",
"watch": "rollup -c -w",
"release": "node release.js"
},
"repository": {
Expand All @@ -19,13 +22,17 @@
},
"homepage": "https://github.com/maniator/servable#readme",
"devDependencies": {
"babel-core": "^6.24.1",
"babel-loader": "^7.0.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"buba": "^4.0.2",
"inquirer": "^3.0.6",
"rimraf": "^2.6.1",
"rollup": "^0.41.6",
"rollup-plugin-buble": "^0.15.0",
"rollup-plugin-license": "^0.3.0",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-sizes": "^0.3.0",
"rollup-watch": "^3.2.2",
"semver": "^5.3.0",
"shelljs": "^0.7.7",
"webpack": "^2.4.1"
"uglify-js": "^3.0.3"
}
}
29 changes: 29 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import buble from 'rollup-plugin-buble';
import nodeResolve from 'rollup-plugin-node-resolve';
import sizes from 'rollup-plugin-sizes';
import license from 'rollup-plugin-license';

const pkg = require('./package.json');

const banner = `servable v${pkg.version}
${pkg.homepage}
@author ${pkg.author}
@preserve`;

export default {
entry: 'src/index.js',
dest: 'dist/index.js',
format: 'umd',
moduleName: 'Servable',
sourceMap: true,
plugins: [
buble(),
sizes(),
license({
banner,
}),
nodeResolve({
jsnext: true
})
]
}
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export * from './Subject';
export * from './Observer';

export * from './utilities';
export * from './utilities/makeHot';

// add on operators
export * from './operators';
Expand Down
2 changes: 0 additions & 2 deletions src/utilities.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
export const noop = () => null;

export * from './utilities/makeHot';

export const isPromise = (p) => p !== null && typeof p === 'object' && typeof p.then === 'function';

export const isObservable = (o$) => o$ !== null && typeof o$ === 'object' && typeof o$.subscribe === 'function';

0 comments on commit e600c15

Please sign in to comment.