React-router demand loading causes the js file packaged by webpack to contain css

this is router

import React from "react";
import {Route, Switch,Redirect} from "react-router-dom"
import {Layout} from "antd"
import "./content.less"
import asyncComponent from "./AsyncComponent"


const AsyncIndex = asyncComponent(() => import("../pages/index/index"))
const AsyncTrade = asyncComponent(() => import("../pages/order/Trade"))
const AsyncTransfer = asyncComponent(() => import("../pages/order/Transfer"))


const {Content} = Layout



export default class Contents extends React.Component {
  render() {
    return (
      <Content className="main-content">
        <Switch>
          <Route path="/merchant/console" exact component={AsyncIndex}/>
          <Route path="/trade/index" exact component={AsyncTrade}/>
          <Route path="/transfer/index" exact component={AsyncTransfer}/>
          <Redirect from="*" to="/merchant/console" />
        </Switch>
      </Content>
    );
  }
}

AsyncComponent

import React, { Component } from "react"

export default function asyncComponent(importComponent) {
  class AsyncComponent extends Component {
    constructor(props) {
      super(props)

      this.state = {
        component: null
      }
    }

    async componentDidMount() {
      const { default: component } = await importComponent()

      this.setState({
        component: component
      })
    }

    render() {
      const C = this.state.component

      return C ? <C {...this.props} /> : null
    }
  }

  return AsyncComponent
}

but after loading webpack on demand, the js file will be mixed with css

clipboard.png

could you tell me how to separate it

Mar.02,2021

it is included without on-demand loading.

The idea of

webpack is to use everything as modules, js, css, fonts, json, images,.

if not in the jsx file, import, can directly introduce

into html.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea7452-1e42.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea7452-1e42.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?