RaPack Basic
2024年11月11日
一、认识
二、准备
构建依赖: 安装 @rspack/core
和 @rspack/cli
为 dev
依赖
pnpm add @rspack/core @rspack/cli -D
三、配置
3.1 package.json
"scripts": {
"dev": "rspack dev",
"build": "rspack build"
}
3.2 rspack.config.js
const Path = require("path");
const rspack = require("@rspack/core");
const devMode = process.env.NODE_ENV !== "production";
/** @type {import('@rspack/cli').Configuration} */
const config = {
entry: {
main: "./src/index.tsx",
},
output: {
path: Path.resolve(__dirname, "dist"),
},
module: {
},
plugins: [
],
};
module.exports = config;