这是我的目录
webpack.config.js-----》
var htmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { entry:'./src/js/main.js', output:{ path:__dirname+'/dist/js/', filename:'[name].js'//__dirname }, plugins:[ new htmlWebpackPlugin() ] }
package.json -----》
{ "name": "project", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "devDependencies": { "html-webpack-plugin": "^2.30.1" } }
html.html------------>
<!DOCTYPE html> <html> <head> <title></title> </head> <body> </body> </html>
QQ_随意
相关分类