Skip to content

Commit

Permalink
R!! Removes WebsmithLoaderOptions#sourceMap
Browse files Browse the repository at this point in the history
fixes #53
  • Loading branch information
jwloka committed Jan 26, 2025
1 parent baa2088 commit c9eb5ae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 22 deletions.
5 changes: 2 additions & 3 deletions packages/webpack/src/loader-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ export interface WebsmithLoaderOptions {
addons?: string[];
addonsDir?: string;
buildDir?: string;
config?: CompilationConfig;
configFile?: string;
config?: CompilationConfig;
debug?: boolean;
project?: string;
sourceMap?: boolean;
targets?: string[];
transpileOnly?: boolean;
tsConfig?: ts.CompilerOptions;
targets?: string[];
webpackTarget?: string;
}

Expand Down
3 changes: 0 additions & 3 deletions packages/webpack/src/options.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ describe("createOptions", () => {
expect(actual).toEqual({
configFilePath: "/expected/tsconfig.json",
outDir: "/lib",
sourceMap: false,
});
});

Expand All @@ -45,7 +44,6 @@ describe("createOptions", () => {
expect(actual).toEqual({
configFilePath: "/expected/tsconfig.json",
outDir: "/lib",
sourceMap: false,
strict: true,
});
});
Expand All @@ -60,7 +58,6 @@ describe("createOptions", () => {
expect(actual).toEqual({
configFilePath: "/expected/tsconfig.json",
outDir: "/lib",
sourceMap: false,
strict: true,
});
});
Expand Down
19 changes: 3 additions & 16 deletions packages/webpack/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,7 @@ import ts from "typescript";
import { WebsmithLoaderConfig } from "./loader-options";

export const createOptions = (args: WebsmithLoaderConfig, reporter: Reporter = new NoReporter(), system = ts.sys): CompilerOptions => {
const {
buildDir,
config,
configFile,
debug = false,
project = "./tsconfig.json",
sourceMap = false,
targets = ["*"],
tsConfig,
transpileOnly,
} = args;
const { buildDir, config, configFile, debug = false, project = "./tsconfig.json", targets = ["*"], tsConfig, transpileOnly } = args;

const cliArgs = resolveTsConfig(project, system);
cliArgs.options = { ...cliArgs.options, ...tsConfig };
Expand All @@ -40,11 +30,8 @@ export const createOptions = (args: WebsmithLoaderConfig, reporter: Reporter = n
cliArgs.options = updateCompilerOptions(cliArgs.options, system, projectDirectory);
}

if (sourceMap !== undefined) {
cliArgs.options.sourceMap = sourceMap;
if (cliArgs.options.sourceMap === false) {
delete cliArgs.options.inlineSources;
}
if (cliArgs.options.sourceMap === false) {
delete cliArgs.options.inlineSources;
}

let mergedConfig = compilationConfig || config ? Object.assign({}, compilationConfig, config) : undefined;
Expand Down

0 comments on commit c9eb5ae

Please sign in to comment.