Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 1.35 KB

zNotes.md

File metadata and controls

41 lines (29 loc) · 1.35 KB

Removed from TrainingSample/package.json:

"devDependencies": { "@types/react": "16.9.51", "@types/react-dom": "16.9.8", "@types/lodash-es": "^4.17.21"

"dependencies": { "lodash-es": "^4.17.21", "react": "16.13.1", "react-dom": "16.13.1"

Before bundling final version to publish for production:

in webpack.config.cjs

change mode to production when pushing final version to minimize library and create single js or CDN

module.exports = { mode: 'development', // switch to production when you package for production - impacts final size of package you import

For this library, things to NOT bundle here: externals: { // Read webpack documentation - do not want to bundle these into the package "react": "React", "lodash-es": "lodash-es/*" },

While developing the library only

Refer to it with the file:.. reference. When the library works, then the consumer should pull from the npm library

"dependencies": { // Use file reference for local copies // // "@mikezimm/sample-library": "^1.0.0", "@mikezimm/sample-library": "file:../trainingSample",