diff --git a/package.json b/package.json index c173f49..fc6a033 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "clean": "rm -rf dist/ && rm -f *.tgz", "clean:build": "npm run clean && npm run build", "build": "concurrently -n rollup,tsc \"npm run build:rollup\" \"npm run build:types\"", - "build:rollup": "rollup -c rollup.config.ts --configPlugin rollup-plugin-typescript2", + "build:rollup": "rollup -c rollup.config.ts --configPlugin \"rollup-plugin-typescript2={ tsconfig: 'tsconfig.rollup.json' } \" ", "build:types": "tsc -p tsconfig.build.json", "build:watch": "concurrently -n rollup,tsc \"npm run build:rollup -- -w\" \"npm run build:types -- -w\"", "tsc": "tsc", diff --git a/tsconfig.json b/tsconfig.json index 1d7d016..a008b62 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,6 +9,8 @@ "outDir": "dist/", // output .d.ts declaration files for consumers "declaration": true, + // output .d.ts.map declaration map files for consumers + "declarationMap": true, // output .js.map sourcemap files for consumers "sourceMap": true, // use Node's module resolution algorithm, instead of the legacy TS one diff --git a/tsconfig.rollup.json b/tsconfig.rollup.json new file mode 100644 index 0000000..d834bfd --- /dev/null +++ b/tsconfig.rollup.json @@ -0,0 +1,12 @@ +{ + // tsconfig.json is used for type-checking _all_ files, tsconfig.rollup.json is just used for parsing rollup.config.ts + "extends": "./tsconfig.json", + // allowlist of files to build -- this is just an optimization + "files": ["rollup.config.ts"], + "compilerOptions": { + // this is currently erroring when used for configPlugins: https://github.com/ezolenko/rollup-plugin-typescript2/issues/310 + "declarationMap": false, + }, + // read this file as a tsconfig even though it's named slightly differently + "$schema": "https://json.schemastore.org/tsconfig", +}