Webpack 以入口为起点分析依赖,输出打包后的资源文件。

本节要点

  • entry 指定入口
  • output 指定产物路径
  • loader 转换非 JS 资源

代码示例

const path = require("path")

module.exports = {
  entry: "./src/index.js",
  output: {
    path: path.resolve(__dirname, "dist"),
    filename: "bundle.js"
  },
  module: {
    rules: []
  }
}