You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using yarn workspaces with lerna (see an example repo of this setup here), where a serverless app is one of my packages, there are issues when determining the dependency graph. One of the serverless' apps workspace packages depends on prettier during runtime, and this is defined in dependencies:
Serverless webpack should not complain that prettier is in devDependencies of my-serverless-service, because it is only used during runtime of package my-package, which does include it under dependencies. Note that my-serverless-service does depend on my-package.
What was the config you used?
webpack.config.js
const path = require('path')
const slsw = require('serverless-webpack')
const nodeExternals = require('webpack-node-externals')
const entries = {}
Object.keys(slsw.lib.entries).forEach(
key => (entries[key] = ['./source-map-install.js', slsw.lib.entries[key]])
)
module.exports = {
mode: slsw.lib.webpack.isLocal ? 'development' : 'production',
entry: entries,
// We use webpack-node-externals to excludes all node deps.
// You can manually set the externals too.
externals: [nodeExternals()],
devtool: 'source-map',
resolve: {
extensions: ['.js', '.jsx', '.json', '.ts', '.tsx']
},
output: {
libraryTarget: 'commonjs',
path: path.join(__dirname, '.webpack'),
filename: '[name].js'
},
target: 'node',
module: {
rules: [
// all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
{ test: /\.tsx?$/, loader: 'ts-loader' }
]
}
}
This is a Bug Report
Description
For bug reports:
When using yarn workspaces with lerna (see an example repo of this setup here), where a serverless app is one of my packages, there are issues when determining the dependency graph. One of the serverless' apps workspace packages depends on
prettier
during runtime, and this is defined independencies
:packages/my-package/package.json
At the same time other packages depend on prettier but for development purposes only, including my serverless app.
packages/my-serverless-service/package.json
Serverless webpack should not complain that
prettier
is indevDependencies
ofmy-serverless-service
, because it is only used during runtime of packagemy-package
, which does include it underdependencies
. Note thatmy-serverless-service
does depend onmy-package
.webpack.config.js
serverless.yml
Additional Data
Serverless-Webpack Version you're using:
5.2.0
Webpack version you're using:
4.16.5
Serverless Framework Version you're using:
Serverless Version: 1.30.0
Operating System:
OS: darwin
Node Version: 8.11.3
The text was updated successfully, but these errors were encountered: