-
-
Notifications
You must be signed in to change notification settings - Fork 784
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
Generate multiple targets with webpack #359
Conversation
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.
Looks great! Just one comment.
.github/workflows/npmpublish.yml
Outdated
@@ -32,6 +32,3 @@ jobs: | |||
node-version: 12 | |||
registry-url: https://registry.npmjs.org/ | |||
- run: yarn --frozen-lockfile | |||
- run: yarn publish |
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.
Can you exclude this file?
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.
Oops, yep. Pushing to my fork complains on that (and CI fails) because I'm not you. I'll put it back for your tree.
Generate prod (minified), dev (inline sourcemap), and 'raw' (mode: none) versions of the library in the 'dist' folder. This closes #346 although for backwards compatibility the minified version is 'fuse.js', the dev version is 'fuse.dev.js', and the unminified version with external sourcemap is 'fuse.raw.js'. Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
@cshoredaniel @krisk Thanks for this. I imagine that |
@obihill Actually if you minify fuse.raw.js with webpack using "mode: production" and
you would get fuse.js (the minified version). fuse.dev.js is built with webpack's development mode stuff so might not be quite the same. fuse.raw.js is build with "mode: none" and no optimizations so that there is no webpack special treatment (beyond the transpilation and turning into a umd module). HTH |
@cshoredaniel Thanks, but I'm not using - nor am I familiar with - Webpack. I was looking for an un-minified version to add to my gulp pipeline. I'm using this to power search for a webapp, and what I do is concatenate all the required libraries, and then minify at the end of the build process. I didn't see reason in further minifying the minified version, so I posted the issue as I couldn't find an un-minified version. I guess this means I can use fuse.raw.js in my build pipeline? |
@obihill Ah, yes you would use fuse.raw.js in your build pipeline although I've learned that UMD modules (even unminified) aren't ideal for minifying which is one of the reasons I'll be working exposing a native es6 module. I misunderstood your question to mean you wanted to know how to reproduce fuse.js (the minified version) from the unminified version. |
@cshoredaniel I'm somewhat old-school with JS, and quite happy with ES5 UMD modules actually. Most of the libraries I have integrated in the webapp I'm working on have un-minified and minified versions on their repos, so I just grab the un-minified versions and put them in the pipeline. I was just looking for the same thing here. It seems to be convention to include uncomplicated un-minified versions, especially for those who do not use webpack, but that appears to be changing of late. |
Generate prod (minified), dev (inline sourcemap), and 'raw' (mode: none)
versions of the library in the 'dist' folder. This closes #346 although
for backwards compatibility the minified version is 'fuse.js', the dev
version is 'fuse.dev.js', and the unminified version with external
sourcemap is 'fuse.raw.js'.
Signed-off-by: Daniel F. Dickinson cshored@thecshore.com