Issue 1:
Bug report

What is the current behavior?

I set devtool: eval-nosources-source-map，after run build, i found source code still in sourcesContent

If the current behavior is a bug, please provide the steps to reproduce.

1、my source code

https://github.com/rootegg/test-webpack

2、set webpack.config.js as blow

module.exports = {
devtool: "eval-nosources-source-map",
mode: "production",
module: {
rules: [
{
test: /.js$/,
exclude: /node_modules/,
use: "babel-loader",
},
],
},
};

3、run webpack command, get output as blow

(() => {
var __webpack_modules__ = {
579: () => {
eval(
"var fn = function fn(b) {\n return console.log(b, a);\n};\nfn(11);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTc5LmpzIiwibmFtZXMiOlsiZm4iLCJiIiwiY29uc29sZSIsImxvZyIsImEiXSwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsid2VicGFjazovL3Rlc3Qtd2VicGFjazUvLi9zcmMvaW5kZXguanM/YjYzNSJdLCJzb3VyY2VzQ29udGVudCI6WyJjb25zdCBmbiA9IChiKSA9PiBjb25zb2xlLmxvZyhiLCBhKTtcclxuZm4oMTEpO1xyXG4iXSwibWFwcGluZ3MiOiJBQUFBLElBQU1BLEVBQUUsR0FBRyxTQUFMQSxFQUFFLENBQUlDLENBQUM7RUFBQSxPQUFLQyxPQUFPLENBQUNDLEdBQUcsQ0FBQ0YsQ0FBQyxFQUFFRyxDQUFDLENBQUM7QUFBQTtBQUNuQ0osRUFBRSxDQUFDLEVBQUUsQ0FBQyJ9\n//# sourceURL=webpack-internal:///579\n"
);
},
},
__webpack_exports__ = {};
__webpack_modules__[579]();
})();

4、use window.btoa get source-map file content

atob('eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTc5LmpzIiwibmFtZXMiOlsiZm4iLCJiIiwiY29uc29sZSIsImxvZyIsImEiXSwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsid2VicGFjazovL3Rlc3Qtd2VicGFjazUvLi9zcmMvaW5kZXguanM/YjYzNSJdLCJzb3VyY2VzQ29udGVudCI6WyJjb25zdCBmbiA9IChiKSA9PiBjb25zb2xlLmxvZyhiLCBhKTtcclxuZm4oMTEpO1xyXG4iXSwibWFwcGluZ3MiOiJBQUFBLElBQU1BLEVBQUUsR0FBRyxTQUFMQSxFQUFFLENBQUlDLENBQUM7RUFBQSxPQUFLQyxPQUFPLENBQUNDLEdBQUcsQ0FBQ0YsQ0FBQyxFQUFFRyxDQUFDLENBQUM7QUFBQTtBQUNuQ0osRUFBRSxDQUFDLEVBQUUsQ0FBQyJ9')

=>

'{"version":3,"file":"579.js","names":["fn","b","console","log","a"],"sourceRoot":"","sources":["webpack://test-webpack5/./src/index.js?b635"],"sourcesContent":["const fn = (b) => console.log(b, a);\\r\\nfn(11);\\r\\n"],"mappings":"AAAA,IAAMA,EAAE,GAAG,SAALA,EAAE,CAAIC,CAAC;EAAA,OAAKC,OAAO,CAACC,GAAG,CAACF,CAAC,EAAEG,CAAC,CAAC;AAAA;AACnCJ,EAAE,CAAC,EAAE,CAAC"}'

What is the expected behavior?

I expected sourcesContent to be empty，same as source code not included

Other relevant information:

webpack version: 5.74.0

Node.js version: 16.17.0

erating System: win10

Additional tools:

Issue 2:
Bug report

What is the current behavior?

The source map string converted by the base64 output of devtool: 'eval-nosources-source-map' still contains the sourcesContent field.

If the current behavior is a bug, please provide the steps to reproduce.

Here is a minimal reproduce:

module.exports = {
entry: './src/index.js',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist'),
},
mode: 'development',
devtool: 'eval-nosources-source-map', // <----- here
};

const output = /* copy the base64 of source map from dist */
console.log(Buffer.from(output, 'base64').toString('utf-8')) // still contains the `sourcesContent` field

What is the expected behavior?

Don't contains the sourcesContent field since the nosources is used.

Other relevant information:

webpack version: 5.74.0

Node.js version: 16

Operating System: -

Additional tools: -