Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
"plugin:import/errors",
"plugin:import/warnings",
],
ignorePatterns: ["*.js"],
ignorePatterns: ["*.js", "nwb.config.ts"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
/coverage

# generated from typescript at build time
/dist

# since this is generated from the typescript file when needed
nwb.config.js

/node_modules
npm-debug.log*

deploy.sh
deploy.js
16 changes: 0 additions & 16 deletions nwb.config.js

This file was deleted.

38 changes: 38 additions & 0 deletions nwb.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const ClosurePlugin = require("closure-webpack-plugin");
import { Configuration } from "webpack";

module.exports = {
type: "react-app",
webpack: {
publicPath: "",

config(config: Configuration): Configuration {
config.entry = "./src/index.js";

if (config.resolve === undefined) config.resolve = {};
config.resolve.extensions = [".ts", ".tsx", ".js", ".jsx"];

if (config.module === undefined) config.module = { rules: [] };
config.module.rules.push({
test: /\.tsx?$/,
exclude: /node_modules/,
use: [{ loader: "awesome-typescript-loader" }],
});

if (config.optimization === undefined) config.optimization = {};
config.optimization.minimizer = [
new ClosurePlugin(
{ mode: "AGGRESSIVE_BUNDLE" },
{
// compiler flags here
}
),
];
// Closure already does this optimization,
// so webpack cannot
config.optimization.concatenateModules = false;

return config;
},
},
};
Loading