-
-
Notifications
You must be signed in to change notification settings - Fork 148
Conversation
I recommend you also to add same |
@TrySound thanks for the comment, added |
|
||
export default Object.assign(base, { | ||
dest: pkg['jsnext:main'], | ||
sourceMap: path.resolve(pkg['jsnext:main']), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better rely on new field :) We should reduce jsnext touching as much as it possible, caz it's legacy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also you may use targets
option which is an array of different write
options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for targets option, if that allows for a single Rollup config.
I'm comfortable with the suggested approach, just wondering if it could be accomplished via a single |
Didn't know about |
@@ -47,5 +43,9 @@ export default { | |||
include: 'node_modules/**', | |||
exclude: '**/*.css' | |||
}) | |||
], | |||
targets: [ | |||
{ dest: pkg.main, sourceMap: path.resolve(pkg.main), format: 'umd', moduleName: pkg.amdName }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@developit Why not just sourceMap: true
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't know, the original config had that path.resolve
. Let me try what happens with sourceMap: true
Do you guys prefer if I squash all commits together? |
@piuccio |
Ah, I see. Cool. |
According to jsforum/jsforum#5 jsnext:main should contain the transpiled version with the exception of ES6 modules. Users can include the library without having to apply the babel transformations needed by this package
done 😃 |
How certain is the ES5 requirement here? I haven't finished reading through that thread, but my understanding so far is that ES2015 (without stage-xx or any one-off plugins) is assumed to be acceptable if the source is already using ES2015 modules. Neither preact nor preact-compat use react-specific stuff, it's all just things from the |
I'm having problems because As for the preset |
@developit Do you support IE? |
@TrySound great question, let's see. My project has to work on IE9+ |
In this case module should have es5+modules entry point to prevent long-time vendor transpiling. |
@piuccio Ahh - here I thought there was no JSX in |
well if you get rid of JSX in the source code, I might be able to use Ultimately I want to tree shake preact and preact-compat. At the moment they're adding 8kb to my project and I'm assuming it can go down. |
I will definitely get rid of the JSX. Everything else in there should just be |
@piuccio Didn't mean to auto-close this issue, but I did just remove all the JSX and add |
Thanks, I'm now on holiday, will let you know next week |
Looks like @megafirzen is running into the same sort of issue now that we're publishing a |
Sorry for the delay, I managed to test it right now and I still have some troubles. JSX is gone but there are a couple of arrow functions here and there (like here) which break my rollup when I use So for the moment I'm stuck with |
@piuccio How's arrow functions breaks rollup? Do you use uglify? Rollup uses acorn which can parse arrow functions and whole es2015. |
Yes it breaks the uglify step |
@piuccio Then enable babel or buble transpiller by yourself. |
@TrySound yeah I might enable babel on node modules but it's a bit weird that I have to compile my dependencies. It certainly makes compiling slower. I might give it another go when I have more time |
It's @developit decision. And I'm not against. Now we can use es6 in browsers. For minifying can be used babili. If you want to support older browsers, you should by yourself prepare that code. es6 is standard, not extension. |
Closing this, I'm not sure using babel on node_modules is the best solution but at least it's a solution |
According to jsforum/jsforum#5
jsnext:main
should contain the transpiled version with the exception of ES6 modules.Users can include the library without having to apply the babel transformations needed by this package