导出默认是忽略?空输出文件

我正在尝试将其与 webpack 捆绑在一起:

import { initContainer } from "./embedTypes/container";
import { initPopup } from "./embedTypes/popup";
import { initBubble } from "./embedTypes/chat";

export default {
  initContainer,initPopup,initBubble,};

webpack.config.js

const path = require("path");

module.exports = {
  mode: "production",entry: "./src/index.ts",output: {
    path: path.resolve(__dirname,"dist"),filename: "main.js",},resolve: {
    extensions: [".ts",".js"],module: {
    rules: [
      {
        test: /\.tsx?/,use: "ts-loader",exclude: /node_modules/,],};

tsconfig.json

{
  "compilerOptions": {
    "module": "ES2015","target": "ES6","moduleResolution": "node","strict": true
  },"include": ["src/**/*.ts","tests/**/*.ts"]
}

它输出一个空的 main.js 文件,我不明白为什么。这是预期的吗?

zhouzombie 回答:导出默认是忽略?空输出文件

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/1083.html

大家都在问