diff --git a/packages/core/integration-tests/test/javascript.js b/packages/core/integration-tests/test/javascript.js index 5cb0d36e2ed..19834f09302 100644 --- a/packages/core/integration-tests/test/javascript.js +++ b/packages/core/integration-tests/test/javascript.js @@ -4053,6 +4053,48 @@ describe('javascript', function() { background-color: #000000; } +.svg-img { + background-image: url("data:image/svg+xml,%3Csvg%3E%0A%0A%3C%2Fsvg%3E%0A"); +}`, + ), + ); + + assert(!cssBundleContent.includes('sourceMappingURL')); + }); + + it('should not include the runtime manifest for `bundle-text`', async () => { + let b = await bundle( + path.join(__dirname, '/integration/bundle-text/index.js'), + { + mode: 'production', + defaultTargetOptions: {shouldScopeHoist: false, shouldOptimize: false}, + }, + ); + + assertBundles(b, [ + { + name: 'index.js', + type: 'js', + assets: ['esmodule-helpers.js', 'index.js'], + }, + { + type: 'svg', + assets: ['img.svg'], + }, + { + type: 'css', + assets: ['text.scss'], + }, + ]); + + let cssBundleContent = (await run(b)).default; + + assert( + cssBundleContent.startsWith( + `body { + background-color: #000000; +} + .svg-img { background-image: url("data:image/svg+xml,%3Csvg%3E%0A%0A%3C%2Fsvg%3E%0A"); }`, diff --git a/packages/runtimes/js/src/JSRuntime.js b/packages/runtimes/js/src/JSRuntime.js index 7449d11446b..21e19ef59bc 100644 --- a/packages/runtimes/js/src/JSRuntime.js +++ b/packages/runtimes/js/src/JSRuntime.js @@ -226,7 +226,9 @@ export default (new Runtime({ if ( shouldUseRuntimeManifest(bundle, options) && - bundleGraph.getChildBundles(bundle).length > 0 && + bundleGraph + .getChildBundles(bundle) + .some(b => b.bundleBehavior !== 'inline') && isNewContext(bundle, bundleGraph) ) { assets.push({