-
-
Notifications
You must be signed in to change notification settings - Fork 392
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
Please provide es module distributable #174
Comments
Nothing in that issue lept out to me as requiring this change. Can you link or specify a specific issue you wish to fix? Webpack definitely works normally with CommonJS and we aren’t going to be moving to ES modules anytime soon since it’s not fully fleshed out under node.js. |
Apparently, in Webpack 4, when it transpiles ES code, it must use The build script for path-to-regexp could publish both CommonJS and ES modules, and then let the dependent decide which one to use. |
@jacobg What build script would that be? There's isn't one today. Also, according to the linked article this should also be fine. It's just use-case A1. If you can build a reproduction I will take a look. |
@blakeembrey I mean adding a build script. Here is an example simple project where the source is common js, but the build also adds an es module: I honestly don't understand the issue exactly, but a lot of people are waving their hands that it is a webpack issue. For me it's tldr; Here is a link to a webpack issue on it: |
Hi, just come with a need for this feature not related to webpack at all. I'm trying to ditch the need to do a build (with rollup) just to test (through karma) a library i develop. Since all code written with ES modules i could just load it, with minimal changes, with current browsers but there's a dependency on path-to-regexp which does not have an es dist I'm willing to do the work but needs some guidance since it will require some technical decisions. The more common way would be write the main source code with ES module and run a build step with babel to convert to commonjs Another way would write a custom build tool (with a few regex) to convert current code to an ES module version. I can do any of the above BTW: both can coexist easily with module/main package entries |
Since was really easy i just did a PR: #190 |
es modules become more and more important... 🤗 what would it take to publish it to also support es modules? how about going the same way sinon did? e.g. in your package.json "main": "index.js",
"module": "index-es.js", and then the only difference between those files is the export syntax or what do you think is needed for you to support es modules as well? |
This has been worked on in #203. |
Please provide es module distributable in npm, i.e., instead of:
Do this:
This is important for webpack applications that have to transpile an ES depedendency that has a transitive dependency on
path-to-regexp
. More on that issue here:vuejs/vue-cli#1568
The text was updated successfully, but these errors were encountered: