Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client 二级目录下的文件不会被 webpack 打包 #47

Closed
fantasyroot opened this issue Apr 19, 2018 · 6 comments
Closed

client 二级目录下的文件不会被 webpack 打包 #47

fantasyroot opened this issue Apr 19, 2018 · 6 comments

Comments

@fantasyroot
Copy link
Contributor

  • Node Version: 8.9
  • Beidou Version: 1.0.2
  • Plugin Name And Version: beidou-webpack
  • React/ReactDOM Versions: 16.2
  • Platform: mac
  • Mini Showcase Repository:
  • Other Info:

Current behavior

  • client 二级目录下 的文件可以被自动路由,但是没有被 webpack 打包,entry 应该遍历一下二级目录。
  • 例如:

http://localhost:6001/mobile/home/indexhttp://localhost:6001/home/index 都可以访问,但是 http://localhost:6001/mobile/home/index 是没有 js 和 css 的,因为没有进入 webpack entry:

Expected behavior

二级目录也能被 webpack 写入 entry 自动打包。例如上面的 /mobile/home/index。 chunk name 规范可以例如 mobile-home

@fantasyroot
Copy link
Contributor Author

自行解决了

@ForeverPx
Copy link

@andong-lad 请问怎么解决的呢?

@ahungrynoob
Copy link
Contributor

举个例子

const entry = factory.get('entry');
  const { port } = defaultConfig.devServer;
  entry.m_bindmailverify = [
    `${require.resolve('webpack-dev-server/client')}?http://0.0.0.0:${port}`,
    require.resolve('webpack/hot/only-dev-server'),
    require.resolve('../client/pages/m/bindmailverify.tsx'),
  ];

@njugray
Copy link
Contributor

njugray commented Jan 24, 2019

@andong-lad 可以设置entry扫描深度

// config.default.js

{
  webpack: {
    custom: {
      depth: 2,
    }
  }
}

@ahungrynoob
Copy link
Contributor

@njugray
额 我试了下 没有效果 ,是在v2.0才有的功能吗

@njugray
Copy link
Contributor

njugray commented Jan 24, 2019

@ahungrynoob 需要升级到V2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants