企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# VUE安装 **webpack 安装:** ![](https://img.kancloud.cn/5a/10/5a1000f05497e4efe9bad5f699c9b9b8_746x441.png) ``` <pre class="calibre13">``` npm install webpack@<span class="token5">3.6</span><span class="token5">.0</span> <span class="token">-</span>g ``` ``` **打包** ``` <pre class="calibre13">``` webpack <span class="token1">.</span><span class="token">/</span>src<span class="token">/</span>main<span class="token1">.</span>js <span class="token1">.</span><span class="token">/</span>dist<span class="token">/</span>bundle<span class="token1">.</span>js ``` ``` **快捷打包** ``` <pre class="calibre13">``` 直接输入webpack就知道打包那个文件到那个文件 在根目录新建一个webpack<span class="token1">.</span>config<span class="token1">.</span>js文件 首先需要npm init初始化 引用node 会生成<span class="token2">package</span><span class="token1">.</span>json文件 如果<span><span class="token4">`package.json`</span></span>里已经声明了依赖,那直接<span><span class="token4">`npm install`</span></span>就会自动安装了。 <span class="token6">//在命令行使用npm run build 代替webpack</span> 在<span class="token2">package</span><span class="token1">.</span>json 使用<span class="token6">//加备注会报错</span> ``` ``` **本地安装webpack** ``` <pre class="calibre13">``` npm install webpack@<span class="token5">3.6</span><span class="token5">.0</span> <span class="token">--</span>save<span class="token">-</span>dev ``` ``` ![](https://img.kancloud.cn/3f/ba/3fba847bd13a29707a03d601016f7a44_1011x547.png) **webpack编译css文件**