Skip to content

Commit

Permalink
add babel and rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
sayan-rudder committed Sep 30, 2019
1 parent c08feab commit 071de37
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
14 changes: 14 additions & 0 deletions rudder-client-javascript/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"presets": [
[
"@babel/env",
{
"modules": false,
"useBuiltIns": "usage",
"targets": {
"node": "4"
}
}
]
]
}
9 changes: 7 additions & 2 deletions rudder-client-javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"author": "",
"license": "ISC",
"devDependencies": {
"jest": "^24.9.0",
"@babel/core": "^7.6.2",
"@babel/preset-env": "^7.6.2",
"eslint": "^6.1.0",
"eslint-config-airbnb": "^18.0.1",
"eslint-config-prettier": "^6.2.0",
Expand All @@ -19,6 +20,10 @@
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.14.3",
"eslint-plugin-react-hooks": "^1.7.0",
"prettier": "^1.18.2"
"jest": "^24.9.0",
"prettier": "^1.18.2",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0"
}
}
25 changes: 25 additions & 0 deletions rudder-client-javascript/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import babel from "rollup-plugin-babel";
import commonjs from "rollup-plugin-commonjs";
import resolve from "rollup-plugin-node-resolve";

export default {
input: "RudderClient.js",
output: [
{
file: "dist/bundle_iife.js",
format: "iife",
name: "analytics"
},
{
file: "dist/bundle_cjs.js",
format: "cjs"
}
],
plugins: [
resolve(),
commonjs(),
babel({
exclude: "node_modules/**"
})
]
};

0 comments on commit 071de37

Please sign in to comment.