Skip to content

Commit 16b0d16

Browse files
committed
Roll up directly from .ts files so the source map relates back to the original .ts files rather than the intermediary .js files
1 parent fc83ec0 commit 16b0d16

File tree

4 files changed

+58
-48
lines changed

4 files changed

+58
-48
lines changed

dist/Autolinker.js

Lines changed: 45 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Autolinker.js.map

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

dist/Autolinker.min.js.map

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

rollup.config.mjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@ import dedent from 'dedent';
22
import fs from 'fs';
33
import { nodeResolve } from '@rollup/plugin-node-resolve';
44
import rollupCommonjs from '@rollup/plugin-commonjs';
5+
import typescript from '@rollup/plugin-typescript';
56

67
const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
78

89
export default {
9-
input: './dist/es2015/autolinker.js',
10+
// Roll up directly from the src .ts files so that the generated source map
11+
// refers to the .ts files' contents rather than the intermediary .js files'
12+
// contents (such as in the './dist/es2015' directory)
13+
input: './src/autolinker.ts',
14+
1015
output: {
1116
file: './dist/autolinker.js',
1217
format: 'umd',
@@ -29,6 +34,11 @@ export default {
2934
browser: true,
3035
}),
3136
rollupCommonjs(),
37+
typescript({
38+
compilerOptions: {
39+
declaration: false, // don't need declaration files for the rolled up autolinker.js file
40+
}
41+
}),
3242
],
3343
treeshake: true,
3444
};

0 commit comments

Comments
 (0)