Skip to content

Commit

Permalink
Merge pull request #131 from aidenybai/path-aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
aidenybai authored Oct 8, 2021
2 parents 0e63920 + e287fe6 commit aab44c4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
1 change: 0 additions & 1 deletion benchmarks/_jsx.mjs

This file was deleted.

1 change: 0 additions & 1 deletion benchmarks/suites/_jsx.mjs

This file was deleted.

8 changes: 7 additions & 1 deletion benchmarks/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { defineConfig } from 'vite';
import { resolve } from 'path';

export default defineConfig({
root: 'benchmarks',
esbuild: {
jsxFactory: 'jsx',
jsxFragment: 'Fragment',
jsxInject: `import { jsx, jsxs, Fragment } from './_jsx'`,
jsxInject: `import { jsx, jsxs, Fragment } from 'million/jsx'`,
},
resolve: {
alias: {
million: resolve(__dirname, '../src'),
},
},
});
2 changes: 1 addition & 1 deletion scripts/dev.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source $(dirname "$0")/helpers.sh

index_html_content="<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"utf-8\" /><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" /><link rel=\"icon\" type=\"image/svg+xml\" href=\"https://raw.githubusercontent.com/aidenybai/million/main/.github/assets/icon.svg\"><title>Million Playground</title><link rel=\"stylesheet\" href=\"./style.css\"><script type=\"module\" src=\"./script.tsx\"></script></head><body></body></html>"
script_tsx_content="import { m, createElement, patch } from '../src/index';
script_tsx_content="import { m, createElement, patch } from 'million';
const app = createElement(m('div', { id: 'app' }, ['Hello World']));
document.body.appendChild(app);
Expand Down
7 changes: 6 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"million": ["src/index"],
"million/*": ["src/*"]
},
"jsx": "react-jsx",
"jsxImportSource": "million",
"lib": ["dom", "esnext"],
Expand All @@ -20,6 +25,6 @@
"declaration": true,
"strict": true
},
"include": ["./src/**/*.ts"],
"include": ["./**/*.ts", "./**/*.tsx"],
"exclude": ["node_modules", "dist", "./src/**/*.js", "./src/**/*.spec.ts"]
}

0 comments on commit aab44c4

Please sign in to comment.