Skip to content

package.json 初始化

npm init

webpack 安装配置

webpack 安装

npm i -D webpack webpack-cli

配置文件

  1. 新建config/base.config.js
js
const path = require("path")
module.exports = {
  entry: {
    main: path.resolve(__dirname, "../src/main.tsx")
  },
  output: {
    path: path.resolve(__dirname, "../dist"),
    filename: "[name]-[hash].js"
  },
  module: {
    rules: [
      {
        test: /\./
      }
    ]
  }
}