Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reexport preact && bundle library #124

Merged
merged 3 commits into from
Dec 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .babelrc

This file was deleted.

15 changes: 15 additions & 0 deletions .babelrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed so that it can be automatically parsed via require in the karma config.

"plugins": [
[ "@babel/plugin-transform-react-jsx", {
"importSource": "preact",
"runtime": "automatic"
} ],
"inline-react-svg",
[ "module-resolver", {
"alias": {
"preact": "./preact",
"react": "./preact/compat"
}
} ]
]
}
5 changes: 3 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
lib
/node_modules
/preact
/dist
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
coverage
lib
/node_modules
/coverage
/preact
/dist
16 changes: 6 additions & 10 deletions karma.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const path = require('path');
const { DefinePlugin } = require('webpack');

const babelConfig = require('./.babelrc');

const basePath = '.';

// configures browsers to run test against
Expand Down Expand Up @@ -64,14 +66,7 @@ module.exports = function(karma) {
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
plugins: [
[ '@babel/plugin-transform-react-jsx', {
'importSource': 'preact',
'runtime': 'automatic'
} ]
]
}
options: babelConfig
}
},
{
Expand Down Expand Up @@ -105,8 +100,9 @@ module.exports = function(karma) {
'main'
],
alias: {
'react': 'preact/compat',
'react-dom': 'preact/compat'
'preact': '/preact',
'react': '/preact/compat',
'react-dom': '/preact/compat'
},
modules: [
'node_modules',
Expand Down
Loading