[英]How to run build after install in webpack library
I have this library https://github.com/dhilst/webpacklibraryexample 我有这个图书馆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. 我可以通过
yarn add git+https://github.com/dhilst/webpacklibraryexample.git
来安装它,但是安装后它不会构建(运行webpack)。 I expect that dist/ folder is present after the installation finishes. 我希望安装完成后存在dist /文件夹。
If I try to use I got an Cannot find module
error. 如果尝试使用,则会
Cannot find module
错误。 What I'm doing wrong? 我做错了什么?
Regards, 问候,
Okay I got this. 好吧,我明白了。 You need the prepare instead of build as in docs:
您需要准备而不是像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.
如果要安装的软件包包含prepare脚本,则在打包和安装软件包之前,将安装其依赖项和devDependencies,并运行prepare脚本。
Also webpack-cli was missing at devDependencies . 在devDependencies上也缺少webpack-cli 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.