Skip to content

Add in package/includes to final build product. #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 22, 2017

Conversation

kopertop
Copy link
Contributor

Resolves #9

@kopertop
Copy link
Contributor Author

I also locked in fs-p to 2.0.0 because I was getting build errors.

src/index.ts Outdated
@@ -53,6 +55,21 @@ class ServerlessPlugin {

// include node_modules into build
fs.symlinkSync(path.resolve('node_modules'), path.resolve(path.join(buildFolder, 'node_modules')))
// include any "extras" from the "include" section
if(this.serverless.service.package.include && this.serverless.service.package.include.length > 0){
globby(this.serverless.service.package.include).then((files) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use async & await here.

src/index.ts Outdated
if(this.serverless.service.package.include && this.serverless.service.package.include.length > 0){
globby(this.serverless.service.package.include).then((files) => {
_.forEach(files, (filename) => {
let destFileName = path.resolve(path.join(buildFolder, filename));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to use const instead of let?

src/index.ts Outdated
_.forEach(files, (filename) => {
let destFileName = path.resolve(path.join(buildFolder, filename));
let dirname = path.dirname(destFileName);
if(!fs.existsSync(dirname)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use spaces like so: if (!fs.existsSync(dirname)) {

(Also applies to other places)

@schickling
Copy link
Contributor

I've added a few comments. Would be great if you could adust it :)

Other minor style updates suggested by @schickling
@kopertop
Copy link
Contributor Author

No problem, sorry I haven't been writing in TypeScript that long and I only recently learned of Async/Await. Does this look better?

@schickling
Copy link
Contributor

Looks great now!

@schickling schickling merged commit 31a971f into serverless:master May 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants