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
Package is not compatible with Create React App and it's testing setup #70
Comments
Good call! I actually was thinking about moving the package declarations back to CommonJS exports. And here is why:
So I would rather have something that can easily be imported without a special setup in both setups until the ES6 modules are fully supported. |
Usually in package.json of popular packages I see "main" for require and "module" for ES6. See https://webpack.js.org/guides/author-libraries/#final-steps The first one points to the dist version with requires, the second also to dist version but with imports. Webpack is reading the later one and is doing tree shaking of es6 modules. But Jest is using the first one and expects no imports there |
Due to reason I was not able to use it in CRA I had to drop it and write an own minimal routing hook. Which is sad as I loved your package idea |
Its here if you're interested :) I am not patching push state |
Looking good! Does this work properly? I had issues with it and it seems like
|
Right, tree shaking seems like a good reason to use ES6 modules. |
Check the source of the Link. Apart from doing a push state it triggers a pop state event. Then the implementation of router is very easy. Yes ES6 is very good. But not for "main" property but for "module" |
Hey @mucsi96 I did some research and I think we could carry a folder called We could also then point the |
Yes that would be awesome. I think supporting users with CRA is much more important then exporting ES6 modules. Espetially that even its work in progress Webpack and rollup reads the module property for ES modules. So I don't see any isse by pointing main to cjs and ponting modules to current entrypoint |
@mucsi96 Hi, I've just released the latest version |
I see the published package contains
import
statements. This produce the following error in default create react app setup after runningnpm test
Can we publish a transpiled version containing
require
statements so no babel transpilation would be required insidenode_modules
?The text was updated successfully, but these errors were encountered: