Comments (4)
@dan-gamble if you want to use highlight.js only on a specific page component, juste import it in your page component:
pages/about.vue
:
<script>
import highlightjs from 'highlight.js'
export default {
}
</script>
Make sure that you don't use highlight.js
in your config.build.vendor
and config.plugins
.
This way, highlight.js will be in the bundle of the /about page and we will be imported only when loading this route 👍
This is due to the code splitting we define in the router of Nuxt.js, like @declandewet described in his comment.
from nuxt.
Hi @dan-gamble - I haven't used Nuxt.js much but @Atinux and I discussed this a lot a few weeks ago so based on that my assumption is it should be possible - and the in the code it looks like it is the default for the client build: https://github.com/nuxt/nuxt.js/blob/master/lib/app/router.js#L9
from nuxt.
Awesome, thanks guys.
from nuxt.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from nuxt.
Related Issues (20)
- HMR doesn't work on pages that are added to .nuxtignore file HOT 6
- updating of experimental options HOT 3
- Option to install layer dependencies with --ignore-scripts HOT 2
- `$fetch` interceptor not modifying the retried request when a body is present HOT 5
- How can we integrate AMP ( Accelerated Mobile pages) In nuxt 3.8 ?
- How override plugins from Nuxt Layer in app? HOT 3
- Why can't the server run? "vue-router": "^4.3.2","vue": "^3.4.26", HOT 2
- How to automatically reference enum types?Why can't implicit references be used? HOT 3
- Styles get added both inline and by reference and precede JS files HOT 2
- A page re-rendering and page deletion composable
- Infinite redirection when using qs after nuxt 3.11 HOT 3
- `Failed to execute 'insertBefore' on 'Node':` with useAsyncData and Pre-Rendering HOT 8
- Improve ignorePrefix JSDoc HOT 2
- No export named 'consola' after upgrading to `v3.11.2` HOT 3
- createError will be requested twice in the get request HOT 2
- Doesn't find indirect dependency of module when using pnpm
- `<ServerOnly>` component (to render markup only once) HOT 3
- Suggestion for new composables: `useResponseHeader(s)` similar to existing `useRequestHeader` composable HOT 1
- SSG: Payload doesn't prefetched when link contains hash property HOT 1
- onUploadProgress on $fetch 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 nuxt.