From e8dec2020c3b9003545ba3e6fb8ed623a7caac66 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 23 Mar 2020 19:13:39 -0400 Subject: [PATCH] Split WebPack chunks, but turn off the size hint warning. Also update the REAMDE to use the JS-version of the viewer script, so that typeRoots don't have to be configured by the users. --- README.md | 2 +- src/ustaxviewer.ts | 16 ++++++++++++++++ tsconfig.json | 4 ++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 088b837..200e3de 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ the "Amount You Owe", for example, which [yields this massive graph](doc/f1040-a See the [ustaxlib] repository for how to get started modeling taxes. To run the viewer, simply do: - npx ustaxviewer-ts taxfile.ts + npx ustaxviewer taxfile.ts Note that `taxfile.ts` should have a default export of the TaxReturn object to be rendered. diff --git a/src/ustaxviewer.ts b/src/ustaxviewer.ts index 6317df3..999bc28 100755 --- a/src/ustaxviewer.ts +++ b/src/ustaxviewer.ts @@ -78,6 +78,22 @@ const compiler = webpack({ ] }, + output: { + filename: '[name].bundle.js', + chunkFilename: '[name].bundle.js', + }, + + optimization: { + minimize: false, + splitChunks: { + chunks: 'all', + } + }, + + performance: { + hints: isTypescript + }, + devServer: { contentBase: [ PUBLIC, diff --git a/tsconfig.json b/tsconfig.json index d97ddd9..bdabc33 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,7 +20,7 @@ "demos" ], "exclude": [ - "node_modules/", - "../ustaxlib" + "./node_modules/", + "./dist/" ] } -- 2.22.5