Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for sourceMap values: hidden, inline #998

Merged
merged 2 commits into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/content/3.config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ Avoid creating chunks.

### `sourceMap`

Enable source-map generation
Enable source-map generation. See [options](https://rollupjs.org/configuration-options/#output-sourcemap)
- Default: `true`

### `node`

Expand Down
5 changes: 3 additions & 2 deletions src/rollup/plugins/esbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const defaultLoaders: { [ext: string]: Loader } = {
export type Options = {
include?: FilterPattern;
exclude?: FilterPattern;
sourceMap?: boolean;
sourceMap?: boolean | "inline" | "hidden";
minify?: boolean;
target: string | string[];
jsxFactory?: string;
Expand Down Expand Up @@ -82,7 +82,8 @@ export function esbuild(options: Options): Plugin {
loader,
target: options.target,
define: options.define,
sourcemap: options.sourceMap,
sourcemap:
options.sourceMap === "hidden" ? "external" : options.sourceMap,
sourcefile: id,
});

Expand Down
2 changes: 1 addition & 1 deletion src/types/nitro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export interface NitroOptions extends PresetOptions {
alias: Record<string, string>;
minify: boolean;
inlineDynamicImports: boolean;
sourceMap: boolean;
sourceMap: boolean | "inline" | "hidden";
node: boolean;
moduleSideEffects: string[];
esbuild?: {
Expand Down