Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
karma-rollup-preprocessor
Advanced tools
Karma preprocessor to bundle ES2015 modules using Rollup.
npm install karma-rollup-preprocessor
All the options detailed in the Rollup Documentation can be passed to rollupPreprocessor
.
Below is a well-founded recommendation using the Bublé ES2015 transpiler:
// karma.conf.js
module.exports = function(config) {
config.set({
files: [
// Make sure to disable Karma’s file watcher
// because the preprocessor will use its own.
{ pattern: 'test/**/*.spec.js', watched: false }
],
preprocessors: {
'test/**/*.spec.js': ['rollup']
},
rollupPreprocessor: {
plugins: [require('rollup-plugin-buble')()],
format: 'iife', // Helps prevent naming collisions.
name: '<your_project>', // Required for 'iife' format.
sourcemap: 'inline' // Sensible for testing.
}
})
}
Below shows an example where configured preprocessors can be very helpful:
// karma.conf.js
module.exports = function(config) {
config.set({
files: [{ pattern: 'test/**/*.spec.js', watched: false }],
preprocessors: {
'test/buble/**/*.spec.js': ['rollup'],
'test/babel/**/*.spec.js': ['rollupBabel']
},
rollupPreprocessor: {
plugins: [require('rollup-plugin-buble')()],
format: 'iife',
name: '<your_project>',
sourcemap: 'inline'
},
customPreprocessors: {
// Clones the base preprocessor, but overwrites
// its options with those defined below...
rollupBabel: {
base: 'rollup',
options: {
// In this case, to use a different transpiler:
plugins: [require('rollup-plugin-babel')()]
}
}
}
})
}
Supports all Rollup plug-ins, and works on Node 4
and up. Happy bundling!
[5.0.3] - 2018-01-05
FAQs
Karma preprocessor to bundle ES modules using Rollup
The npm package karma-rollup-preprocessor receives a total of 52,693 weekly downloads. As such, karma-rollup-preprocessor popularity was classified as popular.
We found that karma-rollup-preprocessor 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.