From: likui <2218301630@qq.com> Date: Thu, 28 Nov 2019 20:21:02 +0000 (+0800) Subject: feat(compiler-sfc): gen source map for style and script block (#497) X-Git-Tag: v3.0.0-alpha.0~132 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=65118327ff9f506d241959d96e1e57871a6427d7;p=thirdparty%2Fvuejs%2Fcore.git feat(compiler-sfc): gen source map for style and script block (#497) --- diff --git a/packages/compiler-sfc/__tests__/parse.spec.ts b/packages/compiler-sfc/__tests__/parse.spec.ts index 0a3cc45770..75ed119686 100644 --- a/packages/compiler-sfc/__tests__/parse.spec.ts +++ b/packages/compiler-sfc/__tests__/parse.spec.ts @@ -4,6 +4,19 @@ import { mockWarn } from '@vue/runtime-test' describe('compiler:sfc', () => { mockWarn() + describe('source map', () => { + test('style block', () => { + const style = parse(`\n`) + .styles[0] + expect(style.map).not.toBeUndefined() + }) + + test('script block', () => { + const script = parse(`\n`).script + expect(script!.map).not.toBeUndefined() + }) + }) + test('should ignore nodes with no content', () => { expect(parse(`