Skip to content

Commit

Permalink
Merge pull request #42 from realityking/rollup
Browse files Browse the repository at this point in the history
Change the build process to use rollup.
  • Loading branch information
lourd authored Feb 22, 2018
2 parents 9b86f0a + edbfaf4 commit 45135ff
Show file tree
Hide file tree
Showing 5 changed files with 692 additions and 423 deletions.
8 changes: 6 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"presets": [
"react",
["es2015", { "loose": true }],
"stage-2"
["env", { "targets": {"node": "current"}, "loose": true }]
],
"plugins": [
"transform-object-rest-spread",
"transform-class-properties",
"add-module-exports"
]
}
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Create components whose prop changes map to a global side effect",
"main": "lib/index.js",
"scripts": {
"build": "babel src --out-dir lib",
"build": "rollup -c",
"clean": "rimraf lib",
"prepublish": "npm test && npm run clean && npm run build",
"test": "mocha",
Expand Down Expand Up @@ -37,9 +37,11 @@
"devDependencies": {
"babel-cli": "^6.18.0",
"babel-core": "^6.21.0",
"babel-preset-es2015": "^6.18.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.0",
"babel-preset-react": "^6.16.0",
"babel-preset-stage-2": "^6.18.0",
"babel-register": "^6.18.0",
"chai": "^3.2.0",
"enzyme": "^2.7.0",
Expand All @@ -49,7 +51,9 @@
"react": "^15.4.2",
"react-addons-test-utils": "^15.4.2",
"react-dom": "^15.4.2",
"rimraf": "^2.4.3"
"rimraf": "^2.4.3",
"rollup": "^0.56.2",
"rollup-plugin-babel": "^3.0.2"
},
"files": [
"LICENSE",
Expand Down
25 changes: 25 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import babel from 'rollup-plugin-babel';
import pkg from './package.json';

export default {
input: 'src/index.js',
output: [
{ file: pkg.main, format: 'cjs' }
],
plugins: [
babel({
babelrc: false,
presets: [
'react',
['env', { targets: {uglify: true}, loose: true, modules: false }]
],
plugins: [
'transform-object-rest-spread',
'transform-class-properties',
'add-module-exports'
],
exclude: 'node_modules/**'
})
],
external: ['shallowequal', 'react', 'exenv']
};
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component } from 'react';
import ExecutionEnvironment from 'exenv';
import shallowEqual from 'shallowequal';

module.exports = function withSideEffect(
export default function withSideEffect(
reducePropsToState,
handleStateChangeOnClient,
mapStateOnServer
Expand Down
Loading

0 comments on commit 45135ff

Please sign in to comment.