Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

curiosity-bundler

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

curiosity-bundler

Unique webpack wrapper for curiosity.

  • 0.2.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
increased by160%
Maintainers
1
Weekly downloads
 
Created
Source

curiosity-bundler

Bundler是一个基于Webpack5的封装工具。它简化了Webpack配置的复杂性,提供了一种更简洁、更直观的方式来打包应用程序。Bundler不仅继承了Webpack的强大功能,如模块热替换和代码分割,还提供了一些额外的工具和设置来优化开发体验和生产效率。

使用

安装

npm i curiosity-bundler -D

项目根目录新建bundler.config.ts

iimport path from 'path'
import { Config } from 'curiosity-bundler'

const config: Config = {
    entry: {
      index: path.join(__dirname, 'src/index.js'),
    },
    html: {
      index: {
        template: path.join(__dirname, 'index.html')
      }
    },
    alias: {
      '@': path.resolve(__dirname, 'src'),
    },
    configWebpack(config) {
      // webpack config
    },
}

export default config

配置说明

  • mode:Webpack的模式设置,可选值为developmentproductionnone
  • context:Webpack的上下文路径
  • entry:Webpack的入口文件
  • html:HtmlWebpackPlugin的选项
  • alias:模块别名,用于Webpack解析
  • externals:外部扩展,这些模块不会被打包到bundle中
  • publicPath:公共URL路径
  • dest:输出目录
  • configWebpack:用户自定义Webpack配置函数
  • extraTranspileIncludes:额外的转译包含路径
  • tsConfigFile:TypeScript配置文件路径
  • hash:是否启用hash
  • minify:是否压缩
  • devServer:开发服务器的配置
  • cssLoaderOptions:CSS加载器选项
  • cssModulesExcludes:CSS模块排除选项
  • lessLoaderOptions:Less加载器选项
  • autoprefixer:自动添加浏览器前缀选项
  • extraPostCSSPlugins:额外的PostCSS插件
  • devtool:Webpack devtool选项
  • analyzer:是否启用包分析器
  • extraPlugins:额外的Webpack插件
  • extarRules:额外的Webpack规则

FAQs

Package last updated on 28 Feb 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc