Comments (9)
I think that main
and browser
are correct, and that the only file that should be in the dist folder is that stand-alone version that can be included in a script tag. That said, I am not really an expert on package bundling, so it could be that there is a better way to do this.
from search-index.
I also think that we should probably be using shipping without a dist
folder and instead make dist
magically appear on installation by adding npm prepare
to package.json
. The UMD version could then be made available directly from GitHub for anybody wanting to bypass bundlers (and/or use it directly from a <script>
tag)
from search-index.
I guess UMD is out of the question, since the build process has to split the result on either levelDB for node or indexedDB for the browser. But ESM for the browser is good. And named exports.
from search-index.
Sounds good. The more portable these formats are, the better 👍👏
from search-index.
I'll try to make CJS and ESM for NodeJS and ESM for the browser. Possibly also UMD for the browser. Even if it isn't anything unified about it, UMD has an easier way to be included in an HTML page. Also makes it easier for search-index to co-exist with other scripts.
from search-index.
And it seems I can look at how the browsers are doing imports now.
https://twitter.com/wesbos/status/1640722393688600578
from search-index.
It seems the bundled version pulls in the whole package.json-file. Does it need that?
And shouldn't main
and browser
in package.json point to files in the dist-folder?
from search-index.
And nother question: Where do you define that you build with browser.js? Or is that just for browser-tests?
from search-index.
I looked a bit at this, but there is too many moving parts that I don't understand, sorry.
from search-index.
Related Issues (20)
- Code examples link is broken HOT 5
- Indexing documents with empty object props HOT 4
- No results found after upgrading from 2.4.0 to 3.0.2 HOT 3
- Optimizing the document format for internal field management. HOT 1
- string values consisting only of special chars break tokenization chain HOT 4
- IMPORT/EXPORT between version 2.4 and 3.1 HOT 1
- Avoid result with 0 count on FACET HOT 1
- Token parsing doesn't accommodate for values that include `:` HOT 6
- switch to `abstract-level` from `abstract-leveldown` HOT 1
- Using search-index with redisdown gives error HOT 4
- document LAST_UPDATED()
- CREATED and LAST_UPDATED should have human readable dates instead of millisecond timestamps
- DOC_VECTORs should be retrievable
- Instantiate using class syntax HOT 1
- Find old results after updating document with same ID but new data HOT 3
- Initializing with an instance of Level HOT 4
- Browser: Uncaught SyntaxError: ambiguous indirect export: si HOT 9
- Numeric SORT not working as expected HOT 3
- How to persist index on disk? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from search-index.