@wisersolutions/transpile-js
v0.0.18
Published
Default Babel config and build scripts for other JavaScript packages
Downloads
28
Readme
transpile-js
Default Babel config and build scripts for other JavaScript packages
Use
- Install using:
npm install @wisersolutions/transpile-js
- Create a
babel.config.js
or.babelrc.js
file in the root folder of your package:
This step is optional, but needed if you use any other tools that rely on Babel, such as Eslint or Jest.module.exports = require('@wisersolutions/transpile-js/babel.config')
- Add a pre-publish task to
package.json
and set the entry points for the published package:
(assuming your entry point is{ "main": "./lib/index.js", "module": "./es/index.js", "scripts": { "prepublishOnly": "transpile-js" } }
src/index.js
). - Add
/es
and/lib
to.gitignore
and create (and populate if needed) a.npmignore
file, so that the transpiled code isn't added to VCS, but it is published.
Development
Install
Install dependencies using:
npm install
Develop
After you modify sources, run the following (or set up your IDE to do it for you):
- format the code using
npm run format
- lint it using
npm run lint
and fix the errors, if there are any.
Publish
Publishing is done in two steps:
- Create a new version tag and push it to the repository:
npm version <patch|minor|major> git push --follow-tags
- Build and publish the new version as a npm package:
npm publish --access public