
Security News
New CNA Scorecard Tool Ranks CVE Data Quality Across the Ecosystem
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
nuxt-build-optimisations
Advanced tools
Instantly speed up your Nuxt.js 2 build time.
With the introduction of Vite, Nuxt feels sluggish. This package aims to give you 'vite-like' speed by modifying your Nuxt and webpack configurations to squeeze extra performance out of the build process.
Dev benchmark: :snowman: ~50% quicker cold starts, :fire: ~instant hot starts
Note: Nuxt 3 will use Vite which will most likely make this package redundant in the future.
Safe
file-loader
Experimental
Risky
Install using yarn or npm. (Nuxt.js 2.10+ is required)
yarn add nuxt-build-optimisations
:warning: This package is in pre-release. Make sure you test your app before deploying this into production.
Within your nuxt.config.js
add the following.
// nuxt.config.js
buildModules: [
'nuxt-build-optimisations',
],
It's recommended you start with the risky profile and see if it works.
// nuxt.config.js
buildOptimisations: {
profile: 'risky'
},
A lot of the speed improvements are from heavy caching, if you have any issues the first thing you should do is clear your cache.
rm -rf node_modules/.cache
Type: risky
| experimental
| safe
| false
Default: experimental
If you have errors on any mode you should increment down in profiles until you find one that works.
Setting the profile to false will disable the optimisations, useful when you want to measure your build time without optimisations.
Type: boolean
or object
Default: false
When measure is enabled with true (options or environment variable), it will use the speed-measure-webpack-plugin
.
If the measure option is an object it is assumed to be speed-measure-webpack-plugin options.
buildOptimisations: {
measure: {
outputFormat: 'humanVerbose',
granularLoaderData: true,
loaderTopFiles: 10
}
}
You can use an environment variable to enable the measure as well.
package.json
{
"scripts": {
"measure": "export NUXT_MEASURE=true; nuxt dev"
}
}
Note: Measure can be buggy and can only work with SSR enabled.
Type: object
Default:
esbuildLoader: true,
esbuildMinifier: true,
imageFileLoader: true,
webpackOptimisations: true
You can disable features if you'd like to skip optimisations.
buildOptimisations: {
features: {
// use url-loader
imageFileLoader: false
}
}
Type: object
Default:
{
target: 'es2015'
}
See (esbuild-loader)[https://github.com/privatenumber/esbuild-loader].
Type: object
Default:
{
target: 'es2015'
}
See (esbuild-loader)[https://github.com/privatenumber/esbuild-loader].
FAQs
Nuxt.js v2 module to automatically make your builds faster.
The npm package nuxt-build-optimisations receives a total of 570 weekly downloads. As such, nuxt-build-optimisations popularity was classified as not popular.
We found that nuxt-build-optimisations demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.