Skip to content

Commit 1f57564

Browse files
author
Brandon Scott
committed
0.7.0 Update webpack config and docs script to point to distribution version of tsconfig to exclude test files from doc/bundling processes
1 parent b2b306d commit 1f57564

3 files changed

Lines changed: 29 additions & 20 deletions

File tree

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"clean": "rimraf dist && rimraf coverage",
7777
"configure:git": "echo Ensuring git hooksPath is set to .githooks directory && git config core.hooksPath .githooks && chmod +x .githooks/*",
7878
"coverage": "jest ./src --coverage",
79-
"docs": "typedoc --mode file --excludeExternals --plugin typedoc-plugin-markdown --readme none",
79+
"docs": "typedoc --tsconfig tsconfig.dist.json --mode file --excludeExternals --plugin typedoc-plugin-markdown --readme none",
8080
"format": "prettier --write \"src/**/*.ts\" --trailing-comma es5",
8181
"postbuild": "npm run docs",
8282
"postpublish": "cross-env-shell \"git add -A && git commit -m \"$npm_package_version\" && git push origin main\"",
@@ -90,5 +90,5 @@
9090
"watch:test": "jest ./src --watch"
9191
},
9292
"types": "dist/index",
93-
"version": "0.6.4"
93+
"version": "0.7.0"
9494
}

webpack.config.js

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,53 @@
1-
const path = require('path');
2-
const fs = require('fs');
1+
const path = require("path");
2+
const fs = require("fs");
33

44
const currentWorkingDirectory = __dirname;
55

6-
const configPromise = new Promise(function (resolve, reject) {
7-
6+
const configPromise = new Promise(function(resolve, reject) {
87
// read the webpack dependency externals config from a separate JSON file
9-
fs.readFile('dependency-externals.json', 'utf8', (err, externalsData) => {
8+
fs.readFile("dependency-externals.json", "utf8", (err, externalsData) => {
109
if (err) {
11-
reject(`Unable to read './dependency-externals.json' file. Reason: ${err}`);
10+
reject(
11+
`Unable to read './dependency-externals.json' file. Reason: ${err}`
12+
);
1213
}
1314

1415
let externalsConfig = {};
1516
try {
1617
externalsConfig = JSON.parse(externalsData);
17-
}
18-
catch (e) {
19-
reject(`Unable to convert './dependency-externals.json' file data to JSON object. Reason: ${e}`);
18+
} catch (e) {
19+
reject(
20+
`Unable to convert './dependency-externals.json' file data to JSON object. Reason: ${e}`
21+
);
2022
}
2123

2224
const webpackConfig = {
23-
entry: path.resolve(currentWorkingDirectory, 'src/index.ts'),
24-
mode: 'production',
25+
entry: path.resolve(currentWorkingDirectory, "src/index.ts"),
26+
mode: "production",
2527
module: {
2628
rules: [
2729
{
2830
test: /\.tsx?$/,
29-
use: 'ts-loader',
31+
use: [
32+
{
33+
loader: "ts-loader",
34+
options: {
35+
configFile: "tsconfig.dist.json",
36+
},
37+
},
38+
],
3039
exclude: /node_modules/,
3140
},
3241
],
3342
},
3443
output: {
35-
path: path.resolve(__dirname, 'dist-global'),
36-
filename: 'index.js',
37-
library: 'AndcultureCode',
38-
libraryTarget: 'umd',
44+
path: path.resolve(__dirname, "dist-global"),
45+
filename: "index.js",
46+
library: "AndcultureCode",
47+
libraryTarget: "umd",
3948
},
4049
resolve: {
41-
extensions: ['.ts', '.js'],
50+
extensions: [".ts", ".js"],
4251
},
4352
};
4453

0 commit comments

Comments
 (0)