diff --git a/scripts/build.js b/scripts/build.js index 2468512af4c..2389c20cc3c 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -41,7 +41,13 @@ function buildEntry (config) { const isProd = /(min|prod)\.js$/.test(file) return rollup.rollup(config) .then(bundle => bundle.generate(output)) - .then(async ({ output: [{ code }] }) => { + .then(async ({ output: [{ code, map }] }) => { + const hasMap = !!map; + const filename = file.split('/').pop(); + if (hasMap) { + code = code + `\n//# sourceMappingURL=${filename}.map`; + write(`${file}.map`, JSON.stringify(map)); + } if (isProd) { const {code: minifiedCode} = await terser.minify(code, { toplevel: true, diff --git a/scripts/config.js b/scripts/config.js index e9f519853f1..5f9eae14cda 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -258,7 +258,8 @@ function genConfig(name) { format: opts.format, banner: opts.banner, name: opts.moduleName || 'Vue', - exports: 'auto' + exports: 'auto', + sourcemap: !!process.env.SOURCE_MAP }, onwarn: (msg, warn) => { if (!/Circular/.test(msg)) { pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy