Comments (4)
The solution seems to be to use following webpack plugin:
new webpack.ContextReplacementPlugin(
/(.+)?parse5(\\|\/)lib(\\|\/)(.+)?/,
path.join(__dirname, 'src'),
{}
)
So, we need to switch to webpack for builds.
from delivery-sdk-js.
This does not completely solve the problem beacuse it many cases we leave compilation up to the client, so they would need to use this webpack plugin (if they were using webpack in the first place).
We have a bundle which solves this.
Ideally though, we might want to consider using our own parser see https://medium.com/@gajus/parsing-absolutely-anything-in-javascript-using-earley-algorithm-886edcc31e5e and https://nearley.js.org/
from delivery-sdk-js.
This is implemented in v4 where we use parse5 (v3 so that dynamic import is not used) for working with HTML under node.js and standard DOM when in browser. So far it seems to be working. More testing is required though.
from delivery-sdk-js.
Closing as fixed
from delivery-sdk-js.
Related Issues (20)
- Ensure order of LinkedItems and LinkedItemCodenames matches RichTextElement value order HOT 5
- Add support for limiting Workflows to Collections HOT 1
- Add support for mp4 image transformation HOT 1
- Apply a global filter to deliveryClient HOT 4
- Update SyncAPI SDK
- .toAllPromise() overrides limit parameter HOT 2
- Range filter gives type error when arguments are date strings HOT 1
- Default Language parameter is not overwritten when a language Parameter is applied at the query level HOT 3
- Error: "Invalid language codename" after updating to 14.3.0 HOT 3
- Retrieve a content type element throws error HOT 1
- Exponential rendering time using `createRichTextObjectResolver` HOT 7
- Support secure access for assets
- cancelToken not canceling the request? HOT 1
- Make Elements.RichTextElement generic HOT 1
- Axios needs to be updated to 1.6 HOT 1
- Worfklow codename in DAPI response HOT 1
- ECONNRESET error code while calling sync API HOT 3
- vulnerability in follow-redirects package as dependency of axios package HOT 2
- Content item name "Constructor" breaks previewDeliveryClient query HOT 4
- Support for new 'excludeElements' query string parameter HOT 1
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 delivery-sdk-js.