Npm provides a prepublish script that allows commands to be run before publishing and upon a local npm i. I suggest adding the build command so that browser users can import dist/waterwheel.js without requiring the manual npm run build. .npmignore is required since dist/waterwheel.js is explicitly ignored in .gitignore (which prepublish falls back to).
Test
Use npm i waterwheel to test this. Make sure a dist dir with a successfully compiled waterwheel.js exists in node_modules/waterwheel/
Coverage remained the same at 100.0% when pulling d2e09ab6930d0bd6418c3763313c0a522c581ed5 on infiniteluke:publish-dist into 77cff0ff2f8ce128ebd462b0d79c7ebbd9b93a1b on acquia:0.6.0.
Coverage remained the same at 100.0% when pulling 12fbbd630ddad0e3e6e375ddfd6c13995031d04d on infiniteluke:publish-dist into 77cff0ff2f8ce128ebd462b0d79c7ebbd9b93a1b on acquia:0.6.0.
Npm provides a
prepublish
script that allows commands to be run before publishing and upon a localnpm i
. I suggest adding thebuild
command so that browser users can importdist/waterwheel.js
without requiring the manualnpm run build
..npmignore
is required sincedist/waterwheel.js
is explicitly ignored in.gitignore
(whichprepublish
falls back to).Test
npm i waterwheel
to test this. Make sure a dist dir with a successfully compiledwaterwheel.js
exists innode_modules/waterwheel/