This package allows injecting some codes for profiling your JavaScript files using node-sjsp and webpack.
npm install sjsp-loader --save-dev
Within your webpack configuration object, you'll need to add the sjsp-loader to the list of modules, like so:
var path = require('path');
module.exports = {
entry: {
'app': './app.js'
},
output: {
filename: '[name].bundle.js'
},
module: {
loaders: [
{
test: /(\.js)$/,
loader: 'sjsp?interval=10',
exclude: [
path.resolve(__dirname, 'node_modules')
]
}
]
}
};
- You can
exclude
vendor modules by adding the directory paths of them as profiling targets.
See the node-sjsp usage.
Interval time of logging the result in seconds (default 10)