简体   繁体   English

在Webpack库中安装后如何运行构建

[英]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.

相关问题 使用带有 webpack 的 npm run build 后如何使用 nginx 提供静态文件 - How to serve static files with nginx after using npm run build with webpack npm安装后如何防止Webpack报错? - How to Prevent Webpack Error after npm Install? 如何在没有 webpack 构建配置的情况下将 React 组件提取到库中? - How to extract React components to a library without webpack build configs? NodeJS-如何在Windows 10上正确安装和运行Webpack? - NodeJS - How to properly install and run Webpack on Windows 10? 如何配置webpack以仅构建运行Angular 5应用程序所需的资产? - How to configure webpack to build only required assets to run the Angular 5 app? 如何从 docker 容器运行 webpack 构建? - How do I run a webpack build from a docker container? Docker 构建(Windows)在 RUN 'npm install' 后挂起 - Docker build (Windows) hangs after RUN 'npm install' 如何通过npm仅安装“build”或“dist”或输出库的结果 - How to install only “build” or “dist” or output result of a library via npm 如何仅在 webpack 完成捆绑包后运行服务器? - How to run server only after webpack completes bundling bundles? 使用 ASAR 构建后如何在电子中运行命令行 - how to run commandline in electron after build with ASAR
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM