[Question] TreeShaking the modules, exclude Jsonld package.
See original GitHub issueI am analysing the bundle size of my project. I realised the jsonld is around 17.3 KB parsed while i am using it at all.
Is it possible to import only the NextSeo component?
I tried import NextSeo from "next-seo/meta/defaultSEO.jsx";
and import NextSeo from "next-seo/meta/defaultSEO";
, but it doesn’t work.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Tree Shaking - webpack
Tree shaking is a term commonly used in the JavaScript context for dead-code elimination. It relies on the static structure of ES2015 module...
Read more >Tree shaking and code splitting in webpack - LogRocket Blog
What is tree shaking? Tree shaking, also known as dead code elimination, is the practice of removing unused code in your production build....
Read more >@parcel/validator-typescript | Yarn - Package Manager
Fix :export in CSS modules; Don't remove unused classes or @keyframes when a CSS module is processed by postcss; Fix bundling issue with...
Read more >rtvjs - npm
The package's ./dist directory contains 3 types of builds: ... The CJS and ESM builds require defining the process.env.NODE_ENV to either "development" or...
Read more >Adobe Captivate Users Group | Hello everyone! - Facebook
Hello Daniel Piñerez did you test to import your scorm package on a other LMS? Maybe on cloud scorm.. And did you already...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @Ktchan825, I’m getting close to publishing V2 of this library. Once published I will investigate tree shaking on it.
Was trying to accomplish the same thing as @Ktchan825, ended up having to import directly from the ES module file (
/lib/next-seo.modern.js
). In my case looked something like this:I am also using Typescript in my project. After changing my import from
from 'next-seo
tofrom 'next-seo/lib/next-seo.modern
it started complaining that it couldn’t find the type files fornext-seo/lib/next-seo.modern
. I was able to fix this by modifying mytsconfig.json
as such: