direflow
direflow copied to clipboard
"emitSourceMap": true. generatesempty source map file
Describe the bug
"emitSourceMap": true does not emit soure map
source map file has following incorrect content
{"version":3,"sources":[],"names":[],"mappings":"","file":"direflowBundle.js","sourceRoot":""}
demo application https://github.com/merajcal/direflow-lit-example/tree/master/direflow-lit
To reproduce
Steps to reproduce the behavior:
- Install '...'
- Open '....'
- Build '....'
- See error
Expected behavior
A clear and concise description of what you expected to happen.
Package Manager:
To install Direflow, I used... (npm / yarn / something else)
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
https://github.com/Silind-Software/direflow/blob/990016cf1569f628f7771729ffbb3cac31f52014/packages/direflow-scripts/src/config/config-overrides.ts#L122
The sourceMap
option was only configured as true
in development
environment,
so we got an empty souce map file after build.
This issue still happens to me especially since this project hasn't been updated in a while. A workaround I found in my .NET Core app with DireflowBundle as a web-component is that if you edit the `webpack-config.js file to this:
const { webpackConfig } = require("direflow-scripts");
const { env } = require("process");
module.exports = (config, env) => ({
...webpackConfig(config, env, {
react: '/cdn/react.js',
reactDOM: 'cdn/react-dom.js',
}),
mode: 'development',
devtool: 'inline-source-map',
optimization:{
minimize: false
}
});
Where you add the mode
, devtool
, and optimization
options...it'll generate an inline source map though the cost is that the file size will go from ~800kb to ~12mb. So don't use it in anything besides dev environments!
Hope this helps if you're reading this from the future ;)