Skip to content
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

Add support for -d option (to generate source-maps) #30

Closed
wants to merge 2 commits into from
Closed

Add support for -d option (to generate source-maps) #30

wants to merge 2 commits into from

Conversation

StefH
Copy link
Contributor

@StefH StefH commented Sep 14, 2016

  • Add support for -d option (to generate source-maps)
  • Fix tests on Windows 7/10 (Note that 2 tests still fail ?)

StefH and others added 2 commits September 14, 2016 14:53
Merge most recent code from main project (2016-09-14)
* Add support for -d option (to generate source-maps)
* Fix tests on Windows 7/10 (Note that 2 tests still fail ?)
@thenikso
Copy link
Contributor

I'd lave that to the webpack configuration itself. I don't really see a value added in having an option. What's your use case?

@StefH
Copy link
Contributor Author

StefH commented Sep 20, 2016

I want to use your project as:

"build:webpack": "rimraf ./dist && serverless webpack --out dist -d"

Which will also build the source-maps.

@HyperBrain HyperBrain mentioned this pull request Jun 30, 2017
@hassankhan
Copy link
Contributor

hassankhan commented Jun 30, 2017

I tend to agree with @thenikso here, this is something I'd prefer my webpack.config.js to handle.

@HyperBrain
Copy link
Member

The webpack config now has access to the whole Serverless context and options. You can use these now to enable sourcemap support dynamically in your config. You even can react on any (new) options you might introduce in your environment by using the exported lib.options object.

// webpack.conf.js
const slsw = require('serverless-webpack');

// This will check for a non standard CLI option --debug
const isDebug = slsw.lib.options.debug;

// Or you can make it dependent on the currently deployed stage
const isDebug = slsw.lib.options.stage === 'dev';

// Or even anything available in the current Serverless execution context
const isDebug = slsw.lib.serverless.XXXXXXXXX;

Closing this PR now as it is now possible to write fully dynamic webpack configurations.

@HyperBrain HyperBrain closed this Aug 10, 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.

4 participants