Angular 6. Html Webpack Pluggin问题
创始人
2024-10-16 04:30:24
0

要解决“Angular 6. Html Webpack Pluggin问题”,你可以按照以下步骤进行操作:

  1. 确保你已经安装了html-webpack-plugin插件。可以通过运行以下命令进行安装:

    npm install --save-dev html-webpack-plugin
    
  2. 打开angular.json文件,并找到architect下的build配置项。在options对象中添加一个新的属性index,并将其值设置为src/index.html

    "architect": {
      "build": {
        "options": {
          "index": "src/index.html",
          ...
        },
        ...
      },
      ...
    }
    
  3. 打开webpack.config.js文件,并在顶部添加以下代码:

    const HtmlWebpackPlugin = require('html-webpack-plugin');
    
  4. module.exports对象中的plugins数组中添加以下代码:

    plugins: [
        new HtmlWebpackPlugin({
            template: './src/index.html',
            filename: './index.html'
        }),
        ...
    ]
    

    这将告诉Webpack将src/index.html作为模板文件,并将生成的文件命名为index.html

  5. 保存文件并重新启动Webpack编译。这通常可以通过运行以下命令来实现:

    npm start
    

这样,你就可以解决“Angular 6. Html Webpack Pluggin问题”。

相关内容

热门资讯

五分钟辅助!pokermast... 五分钟辅助!pokermaster修改器,wepoker安装教程,教程书教程(证实有挂)1、下载好p...
5分钟辅助!wpk辅助,佛手在... 5分钟辅助!wpk辅助,佛手在线大菠萝技巧,手段教程(有挂方法)1、进入游戏-大厅左侧-新手福利-激...
八分钟辅助!wepoker私人... 八分钟辅助!wepoker私人局透视,fishpoker透视底牌,积累教程(了解有挂)1、很好的工具...
十分钟辅助!poker mas... 十分钟辅助!poker master辅助,wepoker透视app下载,妙计教程(发现有挂)1、玩家...
第八分钟辅助!poker辅助器... 第八分钟辅助!poker辅助器免费安装,德普之星有辅助软件吗,方式教程(详细教程)德普之星有辅助软件...
3分钟辅助!aapoker万能... 3分钟辅助!aapoker万能辅助器,wepoker买脚本靠谱吗,大纲教程(的确有挂)3分钟辅助!a...
第9分钟辅助!德州局透视脚本,... 第9分钟辅助!德州局透视脚本,wepoker透视是真的吗,手段教程(有挂秘诀)wepoker透视是真...
5分钟辅助!hhpoker有没... 5分钟辅助!hhpoker有没有辅助,德州局hhpoker,举措教程(有人有挂)1、进入到hhpok...
八分钟辅助!竞技联盟透视插件,... 八分钟辅助!竞技联盟透视插件,wepoker软件辅助程序,绝活教程(存在有挂)1、点击下载安装,we...
第八分钟辅助!pokernow... 第八分钟辅助!pokernow辅助工具,购买的wpk辅助在哪里下载,练习教程(揭秘有挂)1)购买的w...