Closed infiniteluke closed 8 years ago
Addressed in https://github.com/acquia/waterwheel/commit/aa62af2066ea07d11aaae28bd6186a138714c475 and https://github.com/acquia/waterwheel/commit/4d026bfa18f7dabb8d1803235ccf3c470f6c683b
For the record, we decided to do building manually before publishing to NPM. This could be wrapped up in a script that 1) does the build then 2) runs npm publish
, but for now it's a pragmatic approach that avoids the cons of the above approaches. The underlying issue of the built code not being available without devs manually building is solved.
I'm using import '../../path/to/node_modules/waterwheel/dist/waterwheel.js';
which adds Waterwheel
to window
.
Thanks @mattgrill!
The
postinstall
hook for waterwheel attempts to runnpm run build
. I realize now that in my testing, I had already manually runnpm i
directly on the package... When installing waterwheel from your project, the dev dependencies are not installed and therefore the post install hook fails (since webpack etc.. are dev dependencies).A couple options:
prepublish
hook to publish waterwheel with it's build:prepublish
doesn't run onnpm i --save waterwheel
only onnpm i
postinstall
and add dependencies needed for building to production dependenciespostinstall
and pruning them out after.