Skip to content

Commit

Permalink
compile with rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
piuccio committed Jun 30, 2017
1 parent 0bf3dd9 commit d55c038
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 3 deletions.
12 changes: 11 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
{
"presets": ["env", "react"]
"presets": [
["env", {
"modules": false
}],
"react"
],
"env": {
"test": {
"presets": ["env", "react"]
}
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
coverage
dist
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__tests__
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,24 @@
],
"homepage": "https://github.com/en-japan-air/react-intl-formatted-duration",
"license": "MIT",
"main": "index.js",
"main": "dist/bundle.js",
"module": "dist/module.js",
"repository": {
"type": "git",
"url": "https://github.com/en-japan-air/react-intl-formatted-duration"
},
"files": [
"dist",
"index.js",
"messages.js"
],
"scripts": {
"compile": "rollup -c rollup.config.js",
"lint": "eslint index.js",
"test": "jest",
"test:coverage": "jest --coverage",
"test:watch": "jest --watchAll",
"prepublish": "npm run compile",
"posttest": "npm run lint"
},
"devDependencies": {
Expand All @@ -35,7 +43,9 @@
"react": "^15.6.1",
"react-dom": "^15.6.1",
"react-intl": "^2.3.0",
"react-test-renderer": "^15.6.1"
"react-test-renderer": "^15.6.1",
"rollup": "0.43.0",
"rollup-plugin-babel": "2.7.1"
},
"peerDependencies": {
"prop-types": ">= 15.0",
Expand Down
15 changes: 15 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import babel from 'rollup-plugin-babel';
import pkg from './package.json';

export default {
entry: 'index.js',
plugins: [
babel(),
],
external: Object.keys(pkg.peerDependencies),
exports: 'named',
targets: [
{ dest: 'dist/bundle.js', format: 'cjs' },
{ dest: 'dist/module.js', format: 'es' },
],
};

0 comments on commit d55c038

Please sign in to comment.