
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
简单,方便,快捷的配置webpack
支持通过swc和esbuild 加速打包.
内置支持TypeScript
npm install sute --save-dev
# or
yarn add sute --dev
# or
pnpm add sute --save-dev
初始化配置, 生成一个sute.config.js文件.
自动生成entry,output等默认配置
"use strict";
const path = require("path");
const appDir = process.cwd();
const resolveApp = (dir) => path.resolve(appDir, dir);
const ConfigFile = {
entry: {
index: resolveApp("src/index.tsx")//默认resolve.extensions自动匹配src文件
},
output: {
filename: "static/js/[name]_[[hash:8].js",
path: resolveApp("./build"),
clean: true
},
htmlWebpackPlugin: {
title: "sute_cli",
template: resolveApp("./public/index.html")
},
definePlugin: {
BASE_URL: '"./"'
},
copyWebpackPlugin: {
patterns: [
{
from: resolveApp("./public"),
globOptions: {
ignore: [
"**/index.html"
]
}
}
]
},
serve: {
port: 3000,
host: "127.0.0.1",
hot: true,
},
};
module.exports = ConfigFile;
resolve 默认配置
extensions:[".wasm", ".mjs", ".js", ".jsx", ".ts", ".tsx", ".vue", ".json"]
alias: 根据 src 下子目录自动生成,您无需匹配
{
'@': resolveApp("./src"),
pages: resolveApp("./src/pages"),
router: resolveApp("./src/router"),
services: resolveApp("./src/services"),
...
}
启动开发服务器
使用内部webpack实例打包文件
// 常用plugins 便捷化入口.
htmlWebpackPlugin?: HtmlWebpackPlugin.Options,
copyWebpackPlugin?: CopyPlugin.PluginOptions,
definePlugin?: DefinePlugin.Options配置
// 自定义
miniCssExtractPlugin?: boolean, // 是否将css提取到一个独立的css文件中.
threadLoader?: boolean | threadLoader.options // 是否开启多线程打包, boolean 类型和对象类型
buildFileAnaly?: boolean//打包后的文件分析
buildTimeAnaly?: boolean//打包后的时间分析
httpCompressiton?: boolean | compressionWebpackPlugin.options // 是否http 压缩
buildSpeendUp?: boolean | buildSpeendUpType, // 开启esbuild 和swc 加速
esbuildMinimizer?: boolean // 启用esbuild 压缩处理器,
deploy?: autoUploadPluginType | autoUploadPluginType[], // 打包后自动部署~
serve?: IserviceConfig | compilerType,// 开发环境相关依赖
export type buildSpeendUpType = {
type: "swc" | "esbuild",
options: objType
}
type:esbuild 时options默认值
{
// JavaScript version to compile to
loader: "tsx",
target: 'es2015',
}
type:"swc" 时options默认值
{
jsc: {
parser: {
syntax: "typescript",
tsx: true,
decorators: true,
},
transform: {
legacyDecorator: true,
},
externalHelpers: true, // 注意这里设置true时,需要在项目下安装@swc/helpers
target: 'es5',
},
env: {
targets: "last 3 major versions, > 0.1%", // 根据项目设置
mode: "usage",
coreJs: "3" // 根据项目选择
},
isModule: 'unknown'
}
取参
export type autoUploadPluginType = {
buildPath?: string, // 不传为默认打包地址.build下
host: string,
username: string,
password: string,
remotePath: string
}
proxy 传参
{
'/api':{
target: 'http://test1.com/',
changeOrigin: true,
},
'/api2': {
target: 'http://test2.com/',
changeOrigin: true,
},
}
其余 port host hot 等传参和webpack-dev-serve 传参一致.
FAQs
- 简单,方便,快捷的配置webpack
We found that sute demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.