Skip to content

Commit 3f4d172

Browse files
authored
Merge pull request #257 from AnomalyInnovations/beta
Merging v5 beta to master
2 parents 5cb167b + 1bf66bd commit 3f4d172

71 files changed

Lines changed: 17606 additions & 14980 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Ignore user's code that'll be transpiled
22
tests/nullish-coalescing/**
3+
tests/failed-eslint/**

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ serverless-bundle is a [Serverless Framework](https://www.serverless.com) plugin
88
- Linting Lambda functions using [ESLint](https://eslint.org)
99
- Supports transpiling unit tests with [babel-jest](https://github.com/facebook/jest/tree/master/packages/babel-jest)
1010
- Source map support for proper error messages
11+
- Support [esbuild](https://esbuild.github.io) and [esbuild-loader](https://github.com/privatenumber/esbuild-loader) for faster builds
1112

12-
And all this works without having to install Webpack, Babel, ESLint, etc. or manage any of their configs. Simply add serverless-bundle to your app and you are done!
13+
And all this works without having to install Webpack, Babel, ESLint, esbuild, etc. or manage any of their configs. Simply add serverless-bundle to your app and you are done!
1314

1415
```diff
1516
- "eslint"
@@ -22,6 +23,7 @@ And all this works without having to install Webpack, Babel, ESLint, etc. or man
2223
- "babel-eslint"
2324
- "babel-loader"
2425
- "eslint-loader"
26+
- "esbuild-loader"
2527
- "@babel/runtime"
2628
- "@babel/preset-env"
2729
- "serverless-webpack"
@@ -96,8 +98,10 @@ custom:
9698
bundle:
9799
sourcemaps: true # Enable source maps
98100
caching: true # Enable Webpack caching
101+
concurrency: 5 # Set desired concurrency, defaults to the number of available cores
99102
stats: false # Don't print out any Webpack output
100103
linting: true # Enable linting as a part of the build process
104+
esbuild: false # Use esbuild-loader instead of babel or ts for faster builds
101105
disableForkTsChecker: false # Disable the ForkTsChecker plugin, more below
102106
tsConfig: "tsconfig.json" # Path to your 'tsconfig.json', if it's not in the root
103107
forceInclude: # Optional list of NPM packages that need to be included

index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ function applyWebpackOptions(custom, config) {
1919
packager: config.options.packager,
2020
packagerOptions: config.options.packagerOptions,
2121
webpackConfig: getWebpackConfigPath(config.servicePath),
22+
concurrency: config.options.concurrency,
2223
includeModules: {
2324
forceExclude: config.options.forceExclude,
2425
forceInclude: config.options.forceInclude,
@@ -31,9 +32,9 @@ function applyWebpackOptions(custom, config) {
3132
packagePath: path.relative(
3233
config.servicePath,
3334
pkgUp.sync({ cwd: config.servicePath })
34-
)
35+
),
3536
},
36-
excludeFiles: config.options.excludeFiles
37+
excludeFiles: config.options.excludeFiles,
3738
};
3839
}
3940

@@ -63,9 +64,9 @@ function applyUserConfig(config, userConfig, servicePath, runtime) {
6364

6465
Object.assign(config.options, userConfig);
6566

66-
// Default to Node 10 if no runtime found
67+
// Default to Node 12 if no runtime found
6768
config.nodeVersion =
68-
Number.parseInt((runtime || "").replace("nodejs", ""), 10) || 10;
69+
Number.parseInt((runtime || "").replace("nodejs", ""), 10) || 12;
6970
}
7071

7172
class ServerlessPlugin extends ServerlessWebpack {
@@ -75,7 +76,7 @@ class ServerlessPlugin extends ServerlessWebpack {
7576
this.serverless = serverless;
7677
this.options = options;
7778

78-
this.hooks["before:webpack:validate:validate"] = function() {
79+
this.hooks["before:webpack:validate:validate"] = function () {
7980
const service = this.serverless.service;
8081
const servicePath = this.serverless.config.servicePath;
8182

0 commit comments

Comments
 (0)