question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

About module entry es folder usage

See original GitHub issue

What problem does this feature solve?

So now we use babel-plugin-import to reduce bundle size. The pkg.main and pkg.module entry all point warn.js. There is no way import es6 module.

What does the proposed API look like?

Consider change pkg.module: es? But I’m not sure if work as expect.

pkg.module for rollup or webpack tree shaking. Webpack only bundle referencedd components if correct config. /es/warn.js is useless.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:21 (21 by maintainers)

github_iconTop GitHub Comments

4reactions
cncoldercommented, Jul 18, 2017

痛点少一个是一个!

My point is npm i antd-mobile then enjoy it.

砍掉所有入门的门槛,这些门槛其实都属于高级用法,非必选。

  • 没装 babel-plugin-import 打包会大,但是能运行啊,配置对 webpack tree shaking 就行,lodash 也不小,可是人家并没有要求用户一定要装 babel-plugin-lodash,用户想减小打包体积可以深入探索。
  • 没配置 webpack resolve [‘.web.js’] 没关系,我们内部解决所有后缀 #1566 ,入口是 index.js 就对了。
  • 没配置 高清方案,画面不够细腻,但是能显示啊,只不过显示的和其他项目一样粗糙一点罢了,但至少其他 CSS 不用去处理,比如用户想用 nprogress,强制高清后用户还得自己写一个 nprogress.hd.css。(这个已经积重难返了)
  • 没配置 svg-sprite-loader 没问题啊,Icon 默认改成 <Icon src='//cdn.com/xxx.svg' /> 或者 <Icon src='base64 data uri' />,要使用 type 属性这种高级用法的时候才需要配置 svg-sprite-loader。(这个可能还可以抢救一下)

以上是我认为这个项目目前的四大痛点。

目前的状况是用户想尝试一下,安装以后配置半天还不一定成功,少部分不肯放弃的人跑到这里开 issus 也未必找到解决办法。

0reactions
paranoidjkcommented, Aug 4, 2017

close since antd-mobile@2.0 have unlocked this restriction.

https://github.com/ant-design/ant-design-mobile/blob/master/package.json#L31

Read more comments on GitHub >

github_iconTop Results From Across the Web

The JavaScript Modules Handbook – Complete Guide to ES ...
Follow the steps below to learn how to use an ES module. Step 1: Create a project directory. Create a project folder—where this...
Read more >
Using ES modules in Node.js - LogRocket Blog
Package entry points​​ Module files within packages can be accessed by appending a path to the package name. Another way is if the...
Read more >
ES modules: A cartoon deep-dive - Mozilla Hacks - the Web ...
The way this works is that any file loaded using import() is handled as the entry point to a separate graph.
Read more >
Entry and Context - webpack
The base directory, an absolute path, for resolving entry points and loaders from the configuration. const path = require('path'); module.
Read more >
ES modules not supported · Issue #1291 · vercel/pkg - GitHub
assume dhjaks is subfolder under pacakge file parent folder. use build command ... module input with a single change), and bytecode generation that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found