Multiple build targets with gulp & webpack#33
Multiple build targets with gulp & webpack#33brockallen merged 4 commits intoDuendeArchive:devfrom maxmantz:dev
Conversation
| "name": "oidc-client", | ||
| "version": "1.0.0-beta.7", | ||
| "description": "OpenID Connect (OIDC) & OAuth2 client library", | ||
| "main": "lib/oidc-client.min.js", |
There was a problem hiding this comment.
The main now points to the minified version.
|
Yea, looks good. That's a hell of a sourcemap... anyway, thanks |
| }, | ||
| plugins: [ | ||
| ], | ||
| devtool: 'inline-source-map' |
There was a problem hiding this comment.
Come to think of it... why we do need the source map for the non-min version?
There was a problem hiding this comment.
When debugging the unminified files can be used to jump to the ES6 source of the library because of the sourcemaps. I also wonder whether the sourcemap files should also be minified. Having them unminified doesn't add anything useful...
There was a problem hiding this comment.
Ah, I wasn't aware they could link all the way back to the ES6 source files.
There was a problem hiding this comment.
Well, I want to release this this morning if possible... so any last minute suggestions related to this before I pull the trigger?
There was a problem hiding this comment.
Yeah - you can try it out by putting a debugger statement somewhere in your code and hit the console during execution. The source code shown in your browser should be the ES6 source file instead of the transpiled/minified version.
There was a problem hiding this comment.
The only suggestion I have is to use the uglifyPlugins instead of the empty array for the sourcemap build targets in gulpfile.js. The sourcemaps should still work even when the build gets minified, so there is really no reason not to minify it.
There was a problem hiding this comment.
Hmm, added them and now the non-min (for dist) went from 1.9MB to 3.1MB.
There was a problem hiding this comment.
That's strange to say the least - I expected the exact opposite. Maybe minification increases the size of the sourcemap but I'm not sure. Did it only increase for dist or also for lib?
There was a problem hiding this comment.
Ok, just released it. Many thanks for your help @maxmantz!
There was a problem hiding this comment.
Glad I could help.
See issue #31
I've taken parts from @tonyeung and @ArturDorochowicz and used gulp together with webpack to make the build targets. The sourcemaps are in the unminified versions under
lib&dist(at the end of the file). The minified versions don't have sourcemaps to keep the file size down.