Skip to content

[fix] ssr remove css map #6744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/compiler/compile/render_ssr/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { b } from 'code-red';
import Component from '../Component';
import { CompileOptions, CssResult } from '../../interfaces';
import { string_literal } from '../utils/stringify';
import Renderer from './Renderer';
import { INode as TemplateNode } from '../nodes/interfaces'; // TODO
import Text from '../nodes/Text';
@@ -200,11 +199,14 @@ export default function ssr(
main
].filter(Boolean);

// TODO: support css.map
// NOTE: inlining sourcemaps may cause issues for code replacements since
// `sourcesContent` contains the raw source code wrapped in double quotes
const js = b`
${css.code ? b`
const #css = {
code: "${css.code}",
map: ${css.map ? string_literal(css.map.toString()) : 'null'}
map: null
};` : null}

${component.extract_javascript(component.ast.module)}
2 changes: 1 addition & 1 deletion src/runtime/internal/ssr.ts
Original file line number Diff line number Diff line change
@@ -129,7 +129,7 @@ export function create_ssr_component(fn) {
html,
css: {
code: Array.from(result.css).map(css => css.code).join('\n'),
map: null // TODO
map: null // TODO: support css.map
},
head: result.title + result.head
};