diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..d1b02ba --- /dev/null +++ b/.babelrc @@ -0,0 +1,6 @@ +{ + "presets": [ "@babel/preset-env", "@babel/preset-react"], + "plugins": [ + "@babel/plugin-transform-runtime" + ] +} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..41e27cf --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/lib/ +/node_modules/ +package-lock.json \ No newline at end of file diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..08e00bd --- /dev/null +++ b/.npmignore @@ -0,0 +1,3 @@ +/src/ +/test/ +/.github/ \ No newline at end of file diff --git a/package.json b/package.json index 1ef88e4..8bf49ec 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,10 @@ { "name": "magnetic-slider", - "version": "1.0.0", + "version": "1.0.1", "description": "A lightweight extension of @material-ui's Slider component complying to a super-set of its API spec, that enables the thumb to snap to nearby marks on the slider with configurable behaviour.", - "main": "MagneticSlider.js", + "main": "lib/MagneticSlider.js", "scripts": { + "prepublish": "rm -rf lib && NODE_ENV=production babel src --out-dir lib", "test": "npm run test" }, "repository": { @@ -27,5 +28,11 @@ "peerDependencies": { "react": "^17.0.2", "@material-ui/core": "^4.12.3" + }, + "devDependencies": { + "@babel/cli": "^7.16.0", + "@babel/core": "^7.16.0", + "@babel/preset-env": "^7.16.4", + "@babel/preset-react": "^7.16.0" } } diff --git a/MagneticSlider.js b/src/MagneticSlider.js similarity index 100% rename from MagneticSlider.js rename to src/MagneticSlider.js