set arbitrary compile options when calling SSR register function

pull/1226/head
Rich Harris 7 years ago
parent b763714222
commit 9037e93934

@ -2,7 +2,7 @@ import * as fs from 'fs';
import * as path from 'path';
import { compile } from '../index.ts';
const compileOptions = {};
let compileOptions = {};
function capitalise(name) {
return name[0].toUpperCase() + name.slice(1);
@ -17,7 +17,7 @@ export default function register(options) {
}
// TODO make this the default and remove in v2
if ('store' in options) compileOptions.store = options.store;
if (options) compileOptions = options;
}
function _deregister(extension) {

@ -110,10 +110,12 @@ describe("ssr", () => {
delete require.cache[resolved];
});
require("../../ssr/register")({
const compileOptions = Object.assign(config.compileOptions || {}, {
store: !!config.store
});
require("../../ssr/register")(compileOptions);
try {
const component = require(`../runtime/samples/${dir}/main.html`);
const { html } = component.render(config.data, {

Loading…
Cancel
Save