🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

esm-gen-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esm-gen-webpack-plugin

生成esm规范和cjs规范包的webpack插件

latest
Source
npmnpm
Version
3.0.0
Version published
Weekly downloads
3
-50%
Maintainers
1
Weekly downloads
 
Created
Source

介绍

生成esm规范和cjs规范包的webpack插件。

该插件会把指定的位置目录下的代码,编译成esm和cjs格式的代码,并会生成ts类型文件。插件还会帮你把源码中其他类型的文件,比如css文件,直接生成到构建目录中去,其位置源码中位置保持一致。

插件生成的代码目录分别为es和lib,其中es中存放esm规范下的包,而lib中存放cjs规范下的包。

用法

const EsmGenWebpackPlugin= require('esm-gen-webpack-plugin');

// webpack配置
module.exports = {
  // 其他配置
  plugins: [
    new EsmGenWebpackPlugin(options)
  ]
}

配置

选项作用默认值
context插件运行的根目录process.cwd()
rootDir需要编译的源代码目录,基于contextsrc

FAQs

Package last updated on 04 Jul 2023

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