SOMOD makes some changes to the original specification of package.json.
The package.json is validated before every build of the SOMOD module to ensure its correctness.
The following properties in the package.json object have a particular purpose in the SOMOD module.
nameversiondescriptionmodulebuild directory. Webpack and other bundlers use module to resolve the entry point for an ES6 module. SOMOD always generates the entry point at build/lib/index.js, hence this property must have a hardcoded value of build/lib/index.jssideEffectsfalse.main, jsnext:main, typetypingsfilesbuild directory. So files property must include the "build" in the array.somodsomod property in package.json are considered SOMOD modules. The somod build command sets this to the version of somod CLI used during the build.somodPlugins
The somodPlugins contains list of somod plugin names. Read more about SOMOD Plugins herepackage.json{ "name": "my-module", "version": "1.0.0", "module": "build/lib/index.js", "typings": "build/lib/index.d.ts", "files": ["build"], "sideEffects": false, "somod": "1.13.3", "somodPlugins": [], "devDependencies": { "somod": "^1.13.3" } }
In our next section, we will explore the directory structure of a SOMOD module.
Write an email to somod@sodaru.com