webpack 打包html文件


1、安装webpack-html-plugin模块

$ npm install webpack-html-plugin —save-dev

2webpack.config.js文件写入

var WebpackHtmlPlugin = require(‘webpack-html-plugin');

output: {

    path: path.resolve(__dirname, './dist'),

    publicPath: '/dist/',

    filename: '[name].js'

  },

  plugins: [

    new WebpackHtmlPlugin({

      template:'forgetPass.html',

      filename:'forgetPass.html'

    }),

    new WebpackHtmlPlugin({

      template:’app/utils/crawTask/crawTaskProcess/websiteRange/failSheet.html’,

      filename:'utils/crawTask/crawTaskProcess/websiteRange/failSheet.html'

    })

  ]


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM