yt-chat-components 1.0.9 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/webpack.config.js +17 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-chat-components",
3
- "version": "1.0.9",
3
+ "version": "1.1.0",
4
4
  "main": "build/static/js/bundle.min.js",
5
5
  "module": "build/static/js/bundle.min.js",
6
6
  "types": "build/static/js/index.d.ts",
package/webpack.config.js CHANGED
@@ -6,9 +6,11 @@ module.exports = {
6
6
  output: {
7
7
  filename: "bundle.min.js",
8
8
  path: path.resolve(__dirname, "build/static/js"),
9
- libraryTarget: "umd",
10
- globalObject: "this",
11
- library: "YtChatComponents", // 可选,定义全局命名空间
9
+ library: {
10
+ name: "YtChatComponents", // 定义全局命名空间
11
+ type: "umd", // 保持 UMD 格式
12
+ },
13
+ globalObject: "this", // 兼容 Node 和浏览器
12
14
  },
13
15
  module: {
14
16
  rules: [
@@ -49,7 +51,17 @@ module.exports = {
49
51
  usedExports: false, // 禁用 tree-shaking,避免移除 React
50
52
  },
51
53
  externals: {
52
- react: 'react', // 避免重复打包 React
53
- 'react-draggable': 'react-draggable', // 声明为外部依赖
54
+ react: {
55
+ commonjs: "react",
56
+ commonjs2: "react",
57
+ amd: "react",
58
+ root: "React",
59
+ },
60
+ "react-draggable": {
61
+ commonjs: "react-draggable",
62
+ commonjs2: "react-draggable",
63
+ amd: "react-draggable",
64
+ root: "ReactDraggable",
65
+ },
54
66
  },
55
67
  };