Skip to content

Commit

Permalink
fix: set target to es6 for umd (#5559)
Browse files Browse the repository at this point in the history
  • Loading branch information
pearmini authored Sep 18, 2023
1 parent e688283 commit 5afd45a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 9 deletions.
34 changes: 34 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>UMD</title>
<script src="./dist/g2.min.js"></script>
</head>
<body>
<div id="container"></div>
</body>
<script>
const data = [
{ genre: 'Sports', sold: 275 },
{ genre: 'Strategy', sold: 115 },
{ genre: 'Action', sold: 120 },
{ genre: 'Shooter', sold: 350 },
{ genre: 'Other', sold: 150 },
];

const chart = new G2.Chart({
container: 'container',
});

chart
.interval()
.data(data)
.encode('x', 'genre')
.encode('y', 'sold')
.encode('color', 'genre');

chart.render();
</script>
</html>
9 changes: 0 additions & 9 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ export default {
commonjs(),
typescript({
useTsconfigDeclarationDir: true,
tsconfigOverride: {
compilerOptions: {
target: 'es5',
downlevelIteration: true,
allowJs: true, // To transform js files in node_modules to es5.
declaration: false, // Avoid failing to generate types from js files.
},
},
include: ['src/**/*.ts+(|x)', '**/node_modules/**/*.js+(|x)'],
}),
terser(),
],
Expand Down
1 change: 1 addition & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default defineConfig(
port: 8080,
open: '/',
},
build: { outDir: '../' },
},
linkOptions,
),
Expand Down

0 comments on commit 5afd45a

Please sign in to comment.