Skip to content

Commit

Permalink
smaller text-polyfill, minor refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinKavik committed Apr 13, 2019
1 parent f4e2d81 commit 83e4c10
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 30 deletions.
2 changes: 2 additions & 0 deletions index.html
Expand Up @@ -8,6 +8,8 @@
/>
<meta name="description" content="" />
<title>My awesome project</title>
<!-- Because of Edge, see https://github.com/samthor/fast-text-encoding -->
<script type="text/javascript" src="static/text-polyfill.min.js"></script>
</head>
<body>
<section id="app"></section>
Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -32,5 +32,6 @@
"webpack": "^4.29.6",
"webpack-cli": "^3.3.0",
"webpack-dev-server": "^3.2.1"
}
},
"dependencies": {}
}
5 changes: 5 additions & 0 deletions static/text-polyfill.min.js

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

24 changes: 24 additions & 0 deletions tsconfig.base.json
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"target": "es5",
"module": "esNext",
"lib": ["dom", "es2015"],
"strict": true,
"esModuleInterop": true,
"sourceMap": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"strictBindCallApply": true,
"allowJs": false,
"allowUnreachableCode": false,
"allowSyntheticDefaultImports": false,
"allowUnusedLabels": false,
"alwaysStrict": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"strictPropertyInitialization": true
}
}
4 changes: 4 additions & 0 deletions tsconfig.css_classes.json
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.base",
"exclude": ["index.ts"]
}
4 changes: 0 additions & 4 deletions tsconfig.ignore_index_ts.json

This file was deleted.

24 changes: 2 additions & 22 deletions tsconfig.json
@@ -1,24 +1,4 @@
{
"compilerOptions": {
"target": "es5",
"module": "esNext",
"lib": ["dom", "es2015"],
"strict": true,
"esModuleInterop": true,
"sourceMap": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"strictBindCallApply": true,
"allowJs": false,
"allowUnreachableCode": false,
"allowSyntheticDefaultImports": false,
"allowUnusedLabels": false,
"alwaysStrict": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"strictPropertyInitialization": true
}
"extends": "./tsconfig.base",
"exclude": ["index.css_classes.ts"]
}
7 changes: 5 additions & 2 deletions webpack.config.js
Expand Up @@ -8,10 +8,11 @@ const CopyWebpackPlugin = require("copy-webpack-plugin");
const CleanWebpackPlugin = require('clean-webpack-plugin');

module.exports = {
entry: "./index.ts",
entry: {
app: "./index.ts"
},
output: {
path: dist,
filename: "bundle.js"
},
devServer: {
contentBase: dist,
Expand All @@ -27,6 +28,8 @@ module.exports = {
new WasmPackPlugin({
crateDirectory: path.resolve(__dirname, "crate"),
}),
// Uncomment if you have problems with Edge and polyfill in index.html isn't enough
//
// Have this example work in Edge which doesn't ship `TextEncoder` or
// `TextDecoder` at this time.
// new webpack.ProvidePlugin({
Expand Down
2 changes: 1 addition & 1 deletion webpack.css_classes.config.js
Expand Up @@ -34,7 +34,7 @@ module.exports = {
},
{
test: /\.ts$/,
loader: 'ts-loader?configFile=tsconfig.ignore_index_ts.json',
loader: 'ts-loader?configFile=tsconfig.css_classes.json',
}, {
test: /\.css$/,
use: [
Expand Down

0 comments on commit 83e4c10

Please sign in to comment.