Creating NPM Package with Vanilla JavaScript
/
Modularizing JavaScript Codebase
Modularizing JavaScript Codebase
https://leanpub.com/creating-npm-package-with-vanilla-javascript
1. Identify Independent Elements
https://leanpub.com/creating-npm-package-with-vanilla-javascript
2. Split the Elements You Want to Extract into Their Separate Modules
https://leanpub.com/creating-npm-package-with-vanilla-javascript
generateStarIcons.js
https://leanpub.com/creating-npm-package-with-vanilla-javascript
showError.js
https://leanpub.com/creating-npm-package-with-vanilla-javascript
3. Import the Extracted Elements into the
tweetButton.js
File
https://leanpub.com/creating-npm-package-with-vanilla-javascript
4. Configure Jest to Strip the Extension from Import Statements
https://leanpub.com/creating-npm-package-with-vanilla-javascript
5. List the New Modules as Files You Want to Publish on NPM
https://leanpub.com/creating-npm-package-with-vanilla-javascript
6. Release the Latest Version of the Project
https://leanpub.com/creating-npm-package-with-vanilla-javascript
Up next
Epilogue
In this chapter
Modularizing JavaScript Codebase
1. Identify Independent Elements
2. Split the Elements You Want to Extract into Their Separate Modules
3. Import the Extracted Elements into the tweetButton.js File
4. Configure Jest to Strip the Extension from Import Statements
5. List the New Modules as Files You Want to Publish on NPM
6. Release the Latest Version of the Project