Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = function getPlugin(ServerlessPlugin) {
const func = this.S.state.getFunctions({ paths: [evt.options.path] })[0];
const component = func.getComponent();

if (component.runtime === 'nodejs') {
if (component.runtime.indexOf('nodejs') === 0) {
const projectPath = this.S.config.projectPath;
const config = getConfig(projectPath, component, func);

Expand Down
6 changes: 6 additions & 0 deletions lib/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const path = require('path');
const webpack = require('./webpack');
const getExternalsFromStats = require('./getExternalsFromStats');
const getExternalModulePaths = require('./getExternalModulePaths');
const fs = require('fs');


module.exports = function bundle(config, pathDist, component, func) {
Expand Down Expand Up @@ -42,6 +43,11 @@ module.exports = function bundle(config, pathDist, component, func) {
path: `${pathBundled}.map`
});
}
fs.writeFile(path.join(pathDist, 'stats.json'), JSON.stringify(stats.toJson({json: true})), function(err){
if(err){
console.log(err);
}
});

// Reassign pathsPackages property
const externals = getExternalsFromStats(stats);
Expand Down