-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(*): move to Jest and Typescript
- got rid of nwb - using tsc for builds and webpack for dev - now using a hook for most logic - Upgraded to React 16.8.x BREAKING CHANGE: Using named exports
- Loading branch information
Showing
9 changed files
with
10,033 additions
and
12,291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
/coverage | ||
/demo/dist | ||
/es | ||
/lib | ||
/node_modules | ||
/umd | ||
/build | ||
/dist | ||
/examples/dist | ||
npm-debug.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
src | ||
examples | ||
.babelrc | ||
.gitignore | ||
webpack.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<html> | ||
<head> | ||
<title>My Component Demo</title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
</head> | ||
<body> | ||
<noscript> | ||
You need to enable JavaScript to run this app. | ||
</noscript> | ||
<div id="root"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
const path = require("path") | ||
const HtmlWebpackPlugin = require("html-webpack-plugin") | ||
const htmlWebpackPlugin = new HtmlWebpackPlugin({ | ||
template: path.join(__dirname, "examples/src/index.html"), | ||
filename: "./index.html" | ||
}) | ||
|
||
module.exports = { | ||
entry: path.join(__dirname, "examples/src/index.js"), | ||
output: { | ||
path: path.join(__dirname, "examples/dist"), | ||
filename: "bundle.js" | ||
}, | ||
|
||
// Enable sourcemaps for debugging webpack's output. | ||
devtool: "source-map", | ||
|
||
resolve: { | ||
// Add '.ts' and '.tsx' as resolvable extensions. | ||
extensions: [".ts", ".tsx", ".js", ".jsx", ".json"] | ||
}, | ||
|
||
module: { | ||
rules: [ | ||
// All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'. | ||
{ | ||
test: /\.tsx?$/, | ||
loader: "awesome-typescript-loader" | ||
}, | ||
{ | ||
test: /\.(js|jsx)$/, | ||
exclude: /node_modules/, | ||
use: ["babel-loader"] | ||
}, | ||
|
||
// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'. | ||
{ enforce: "pre", test: /\.js$/, loader: "source-map-loader" } | ||
] | ||
}, | ||
|
||
// When importing a module whose path matches one of the following, just | ||
// assume a corresponding global variable exists and use that instead. | ||
// This is important because it allows us to avoid bundling all of our | ||
// dependencies, which allows browsers to cache those libraries between builds. | ||
// externals: { | ||
// react: "React", | ||
// "react-dom": "ReactDOM" | ||
// }, | ||
plugins: [htmlWebpackPlugin], | ||
devServer: { | ||
port: 3000 | ||
} | ||
} |