Closed Tidyzq closed 5 years ago
In order to fix issue: https://github.com/vuejs/rollup-plugin-vue/issues/239 The reason is that rollup will manipulate the styles.map.mapping object, which is in https://github.com/rollup/rollup/blob/ea82d134400ecee72e274a02b0e623959e1b36a8/src/utils/transform.ts#L30
styles.map.mapping
if (originalSourcemap && typeof originalSourcemap.mappings === 'string') originalSourcemap.mappings = decode(originalSourcemap.mappings);
So we should return a fresh copy by JSON.stringify and JSON.parse when the cache is hit.
JSON.stringify
JSON.parse
The output SFC descriptor should be treated immutable. Rollup plugin should create a copy of descriptor rather than manipulating it directly.
In order to fix issue: https://github.com/vuejs/rollup-plugin-vue/issues/239 The reason is that rollup will manipulate the
styles.map.mapping
object, which is in https://github.com/rollup/rollup/blob/ea82d134400ecee72e274a02b0e623959e1b36a8/src/utils/transform.ts#L30So we should return a fresh copy by
JSON.stringify
andJSON.parse
when the cache is hit.