圖片描述html
a.js
,b.js
,c.js
文件中分別寫入export default function() { console.log("this is a/b/c.js") }
import a from "./js/a.js"; import b from "./js/b.js"; import c from "./js/c.js";
const path = require("path"); module.export = { //入口 entry: "./src/app.js" //輸出 output: { path: path.resolve(__dirname, dist); //必定要寫絕對路徑 filename: "main.js" } }
npm init -y
npm install webpack --save-dev
webpack
1. html-webpack-plugin插件
webpack.config.js
文件中新增以下代碼
html-webpack-plugin
npm install html-webpack-plugin --save-dev
webpack
webpack