Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

umd and es targets instead of import source #234

Merged
merged 3 commits into from
Mar 19, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "3.0.6",
"description": "Logger for Redux",
"main": "dist/redux-logger.js",
"module": "dist/redux-logger.es.js",
"jsnext:main": "dist/redux-logger.es.js",
"scripts": {
"lint": "eslint src",
"test": "npm run lint && npm run spec",
Expand All @@ -12,7 +14,8 @@
"coverage:html": "nyc report --reporter=html && http-server -p 8077 ./coverage -o",
"coverage:production": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
"clean": "rimraf dist",
"build": "rollup -c",
"uglify": "uglifyjs dist/redux-logger.js -cm -o dist/redux-logger.js",
"build": "rollup -c && npm run uglify",
"precommit": "npm test",
"prepublish": "npm run clean && npm test && npm run build"
},
Expand All @@ -38,8 +41,7 @@
]
},
"files": [
"dist",
"src"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you bring back src folder? I think some users can rely on this and I don't see reasons break it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

"dist"
],
"repository": {
"type": "git",
Expand Down Expand Up @@ -79,8 +81,8 @@
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-uglify": "^1.0.2",
"sinon": "^1.17.7"
"sinon": "^1.17.7",
"uglify-js": "^3.0.8"
},
"dependencies": {
"deep-diff": "^0.3.5"
Expand Down
18 changes: 12 additions & 6 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from 'rollup-plugin-node-resolve';
import uglify from 'rollup-plugin-uglify';

export default {
entry: 'src/index.js',
format: 'umd',
exports: 'named',
moduleName: 'reduxLogger',
dest: 'dist/redux-logger.js',
plugins: [
babel({
babelrc: false,
Expand All @@ -29,7 +25,17 @@ export default {
jsnext: true,
main: true,
browser: true,
}),
uglify(),
})
],
targets: [
{
format: 'umd',
moduleName: 'reduxLogger',
dest: 'dist/redux-logger.js',
},
{
format: 'es',
dest: 'dist/redux-logger.es.js'
}
]
};