简体   繁体   中英

How to run build after install in webpack library

I have this library https://github.com/dhilst/webpacklibraryexample

I can install it by yarn add git+https://github.com/dhilst/webpacklibraryexample.git but it wont build (run webpack) after install. I expect that dist/ folder is present after the installation finishes.

If I try to use I got an Cannot find module error. What I'm doing wrong?

Regards,

Okay I got this. You need the prepare instead of build as in docs:

If the package being installed contains a prepare script, its dependencies and devDependencies will be installed, and the prepare script will be run, before the package is packaged and installed.

Also webpack-cli was missing at devDependencies .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM