-
Notifications
You must be signed in to change notification settings - Fork 417
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
Provide a simple way to differentiate between build types #232
Comments
The You could check if they are already available when the webpack config is loaded (never checked that). If you want to distinguish the settings in your // webpack config
const slsw = require('serverless-webpack');
const options = slsw.lib.options;
const serverless = slsw.lib.serverless; Options contains all command line options (as well as the stage) and |
Additionally you should set |
The environment bars are not defined during the build, which is exactly the issue (checked that before). |
I checked Serverless. The most robust solution would be that Serverless and serverless-offline would set the local indicator variables in their For now, there might be the possibility to check the |
@pierreis I found a possible solution for the recognition without having to fix each and every plugin that does anything offline or locally. PR #334 adds a new So any check for Could you tell me if that will work for you and probably make a test with ( |
Released with 5.0.0 |
-Probably a simple one.
I do not see a simple way to differentiate during the build process between a local build (for example with
serverless-offline
), and a build to be executed on AWS.Would it be possible to include some type of environment variable to distinguish local and AWS builds?
Best option I dound so far is
process.argv.indexOf('offline') === -1
, which works but doesn't look optimal to me.--
Less importantly, serverless options are not passed to the build process (notably the stage). This one is less critical – as it is possible to point from
serverless.yml
to different configuration files, but still. It would be nice :)The text was updated successfully, but these errors were encountered: