Skip to content

Commit

Permalink
Roll up directly from .ts files so the source map relates back to the…
Browse files Browse the repository at this point in the history
… original .ts files rather than the intermediary .js files
  • Loading branch information
gregjacobs committed Dec 25, 2024
1 parent fc83ec0 commit 16b0d16
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 48 deletions.
90 changes: 45 additions & 45 deletions dist/Autolinker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/Autolinker.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/Autolinker.min.js.map

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ import dedent from 'dedent';
import fs from 'fs';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import rollupCommonjs from '@rollup/plugin-commonjs';
import typescript from '@rollup/plugin-typescript';

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

export default {
input: './dist/es2015/autolinker.js',
// Roll up directly from the src .ts files so that the generated source map
// refers to the .ts files' contents rather than the intermediary .js files'
// contents (such as in the './dist/es2015' directory)
input: './src/autolinker.ts',

output: {
file: './dist/autolinker.js',
format: 'umd',
Expand All @@ -29,6 +34,11 @@ export default {
browser: true,
}),
rollupCommonjs(),
typescript({
compilerOptions: {
declaration: false, // don't need declaration files for the rolled up autolinker.js file
}
}),
],
treeshake: true,
};

0 comments on commit 16b0d16

Please sign in to comment.