Skip to content

Commit

Permalink
Add support for React components. (#18)
Browse files Browse the repository at this point in the history
* Add support for React components.

This adds support for react components via a new `extensions` config in astro.config.mjs. In the future we can extend this to do things like look at the import statements, as Snowpack does.

* Fix the tests
  • Loading branch information
matthewp committed Mar 23, 2021
1 parent 3f16550 commit 854d0fe
Show file tree
Hide file tree
Showing 18 changed files with 388 additions and 52 deletions.
5 changes: 4 additions & 1 deletion examples/snowpack/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
export default {
projectRoot: '.',
hmxRoot: './astro',
dist: './_site'
dist: './_site',
extensions: {
'.jsx': 'preact'
}
}
1 change: 1 addition & 0 deletions examples/snowpack/astro/layouts/post.hmx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
.grid-body {
padding: 20px 0 0 0;
}
}

.header-snowpack {
font-size: 3.5rem;
Expand Down
161 changes: 161 additions & 0 deletions examples/snowpack/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/snowpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"postcss-preset-env": "^6.7.0",
"prettier": "^2.0.5",
"snowpack": "^3.1.0-pre.14",
"sass": "^1.32.8",
"stylelint": "^13.8.0",
"stylelint-config-prettier": "^8.0.2",
"stylelint-config-rational-order": "^0.1.2",
Expand Down
Loading

0 comments on commit 854d0fe

Please sign in to comment.