
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.
@winme/webpack-scripts
Advanced tools
快速搭建 webpack react 环境的命令行脚本工具
npm install @winme/webpack-scripts -D
然后在 package.json 修改启动与打包命令脚本
{
"scripts" {
"start": "winme start",
"build": "winme build"
}
}
typescriptwebpack,仅需通过配置文件修改少量的配置webpack 配置如果是老项目迁移,基本无需配置太多,该插件包含了所有主流用到的 loader, plugin,和一些通用 webpack 配置
如果是一个全新项目,只要遵循以下 2 个默认配置,即可快速创建一个 react 项目
记得安装
react和react-dom
src/index 会自动检测是 js 文件还是 ts 文件index.html如果你没办法修改或者不喜欢上述默认配置路径,同样可以通过设置配置文件去修改它们以及更多定制化的需求
可以在项目下创建 winme-scripts.config.js,使用 commonjs 语法导出配置对象
也可以通过 const { defineConfig } = require('@winme/webpack-scripts');,使用 defineConfig 函数包裹导出对象,这样能够获得属性提醒
string/公共路径,等同于 webpack output 中的 publicPath
示例:
const { defineConfig } = require('@winme/webpack-scripts');
module.exports = defineConfig({
publicPath: process.env.NODE_ENV === 'production' ? '/publicPath/' : '/',
});
stringdist打包目录
string/path/to/project/index.htmlhtml 模板路径,默认在 index.html 下,也可以自行设置
object{ @: path.join(__dirname, 'src') }webpack 路径别名,默认已处理 @ 指向根目录 src 下
object{ port: 3000 }开发服务器 server 配置
babel 配置,默认配置已经支持 react + ts 环境,如果需要额外配置,会自动合并
postcss 配置,默认配置了 autoprefixer 插件,如果需要额外配置,会自动合并
object-less 变量
booleanfalse是否生成生产环境 sourcemap
(config) => config-自定义 webpack 配置,需返回新的完整配置
示例:
const { defineConfig } = require('@winme/webpack-scripts');
module.exports = defineConfig({
webpack: config => {
config.output.path = 'build';
config.plugins.push(new Webpack.definePlugin());
return config;
},
});
booleanfalse是否禁用打包文件 size 输出信息,禁用后,打包完成将不会在终端输出所有 js 文件的 size 信息
FAQs
快速搭建 `webpack` `react` 环境的命令行脚本工具
We found that @winme/webpack-scripts 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.