Skip to content

Commit 1bdd624

Browse files
committed
prevent accidentally reintroducing ES6 into shared helpers
1 parent f3eeaa9 commit 1bdd624

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export interface CompileOptions {
5555
hydratable?: boolean;
5656
legacy?: boolean;
5757
customElement?: CustomElementOptions | true;
58+
css?: boolean;
5859

5960
onerror?: (error: Error) => void;
6061
onwarn?: (warning: Warning) => void;

src/shared/_build.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ fs.readdirSync(__dirname).forEach(file => {
1616
ast.body.forEach(node => {
1717
if (node.type !== 'ExportNamedDeclaration') return;
1818

19+
// check no ES6+ slipped in
20+
acorn.parse(source.slice(node.declaration.start, node.end), {
21+
ecmaVersion: 5
22+
});
23+
1924
const declaration = node.declaration;
2025
if (!declaration) return;
2126

@@ -34,5 +39,7 @@ fs.readdirSync(__dirname).forEach(file => {
3439
fs.writeFileSync(
3540
'src/generators/dom/shared.ts',
3641
`// this file is auto-generated, do not edit it
37-
export default ${JSON.stringify(declarations, null, '\t')};`
42+
const shared: Record<string, string> = ${JSON.stringify(declarations, null, '\t')};
43+
44+
export default shared;`
3845
);

0 commit comments

Comments
 (0)