Skip to content

Commit 9d94fde

Browse files
committed
Use sourceMap: true with webpack/ts-loader and inlineSourceMap: true with tsc to support source maps with CodeSandbox
ts-loader and friends don't play nice with inlineSourceMap: true See Error when using inline sourcemaps s-panferov/awesome-typescript-loader#171
1 parent 75be01e commit 9d94fde

File tree

16 files changed

+35
-25
lines changed

16 files changed

+35
-25
lines changed

examples/ClubMembers/webpack.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as path from 'path';
1+
import path from 'path';
22
import { Configuration } from 'webpack';
33

44
const config: Configuration = {
@@ -17,7 +17,7 @@ const config: Configuration = {
1717

1818
module: {
1919
rules: [
20-
{ test: /\.tsx?$/, loader: 'ts-loader', options: {onlyCompileBundledFiles: true, compilerOptions: {noEmit: false, module: 'esnext', declaration: false}} },
20+
{ test: /\.tsx?$/, loader: 'ts-loader', options: {onlyCompileBundledFiles: true, compilerOptions: {noEmit: false, module: 'esnext', sourceMap: true}} },
2121
{ test: /\.js$/, loader: 'source-map-loader' },
2222
{ test: /\.(html|css|png)$/, loader: 'file-loader', options: {name: '[path][name].[ext]'} }
2323
]

examples/HTML5Constraints/webpack.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as path from 'path';
1+
import path from 'path';
22
import { Configuration } from 'webpack';
33

44
const config: Configuration = {
@@ -17,7 +17,7 @@ const config: Configuration = {
1717

1818
module: {
1919
rules: [
20-
{ test: /\.tsx?$/, loader: 'ts-loader', options: {onlyCompileBundledFiles: true, compilerOptions: {noEmit: false, module: 'esnext', declaration: false}} },
20+
{ test: /\.tsx?$/, loader: 'ts-loader', options: {onlyCompileBundledFiles: true, compilerOptions: {noEmit: false, module: 'esnext', sourceMap: true}} },
2121
{ test: /\.js$/, loader: 'source-map-loader' },
2222
{ test: /\.(html|css|png)$/, loader: 'file-loader', options: {name: '[name].[ext]'} }
2323
]

examples/NoFramework/webpack.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as path from 'path';
1+
import path from 'path';
22
import { Configuration } from 'webpack';
33

44
const config: Configuration = {
@@ -17,7 +17,7 @@ const config: Configuration = {
1717

1818
module: {
1919
rules: [
20-
{ test: /\.tsx?$/, loader: 'ts-loader', options: {onlyCompileBundledFiles: true, compilerOptions: {noEmit: false, module: 'esnext', declaration: false}} },
20+
{ test: /\.tsx?$/, loader: 'ts-loader', options: {onlyCompileBundledFiles: true, compilerOptions: {noEmit: false, module: 'esnext', sourceMap: true}} },
2121
{ test: /\.js$/, loader: 'source-map-loader' },
2222
{ test: /\.(html|css|png)$/, loader: 'file-loader', options: {name: '[name].[ext]'} }
2323
]

examples/Password/webpack.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as path from 'path';
1+
import path from 'path';
22
import { Configuration } from 'webpack';
33

44
const config: Configuration = {
@@ -17,7 +17,7 @@ const config: Configuration = {
1717

1818
module: {
1919
rules: [
20-
{ test: /\.tsx?$/, loader: 'ts-loader', options: {onlyCompileBundledFiles: true, compilerOptions: {noEmit: false, module: 'esnext', declaration: false}} },
20+
{ test: /\.tsx?$/, loader: 'ts-loader', options: {onlyCompileBundledFiles: true, compilerOptions: {noEmit: false, module: 'esnext', sourceMap: true}} },
2121
{ test: /\.js$/, loader: 'source-map-loader' },
2222
{ test: /\.(html|css|png)$/, loader: 'file-loader', options: {name: '[path][name].[ext]'} }
2323
]

examples/PasswordNoState/webpack.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as path from 'path';
1+
import path from 'path';
22
import { Configuration } from 'webpack';
33

44
const config: Configuration = {
@@ -17,7 +17,7 @@ const config: Configuration = {
1717

1818
module: {
1919
rules: [
20-
{ test: /\.tsx?$/, loader: 'ts-loader', options: {onlyCompileBundledFiles: true, compilerOptions: {noEmit: false, module: 'esnext', declaration: false}} },
20+
{ test: /\.tsx?$/, loader: 'ts-loader', options: {onlyCompileBundledFiles: true, compilerOptions: {noEmit: false, module: 'esnext', sourceMap: true}} },
2121
{ test: /\.js$/, loader: 'source-map-loader' },
2222
{ test: /\.(html|css|png)$/, loader: 'file-loader', options: {name: '[name].[ext]'} }
2323
]

examples/ServerSideRendering/webpack.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as path from 'path';
1+
import path from 'path';
22
import { Configuration } from 'webpack';
33
import nodeExternals from 'webpack-node-externals';
44

@@ -9,7 +9,7 @@ const output = {
99

1010
const extensions = ['.js', '.jsx', '.ts', '.tsx'];
1111

12-
const tsLoaderRule = { test: /\.tsx?$/, loader: 'ts-loader', options: {onlyCompileBundledFiles: true, compilerOptions: {noEmit: false, module: 'esnext', declaration: false}} };
12+
const tsLoaderRule = { test: /\.tsx?$/, loader: 'ts-loader', options: {onlyCompileBundledFiles: true, compilerOptions: {noEmit: false, module: 'esnext', sourceMap: true}} };
1313

1414
const config: Configuration[] = [
1515
{

examples/SignUp/webpack.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as path from 'path';
1+
import path from 'path';
22
import { Configuration } from 'webpack';
33

44
const config: Configuration = {
@@ -17,7 +17,7 @@ const config: Configuration = {
1717

1818
module: {
1919
rules: [
20-
{ test: /\.tsx?$/, loader: 'ts-loader', options: {onlyCompileBundledFiles: true, compilerOptions: {noEmit: false, module: 'esnext', declaration: false}} },
20+
{ test: /\.tsx?$/, loader: 'ts-loader', options: {onlyCompileBundledFiles: true, compilerOptions: {noEmit: false, module: 'esnext', sourceMap: true}} },
2121
{ test: /\.js$/, loader: 'source-map-loader' },
2222
{ test: /\.(html|css|png)$/, loader: 'file-loader', options: {name: '[name].[ext]'} }
2323
]

examples/WizardForm/webpack.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as path from 'path';
1+
import path from 'path';
22
import { Configuration } from 'webpack';
33

44
const config: Configuration = {
@@ -17,7 +17,7 @@ const config: Configuration = {
1717

1818
module: {
1919
rules: [
20-
{ test: /\.tsx?$/, loader: 'ts-loader', options: {onlyCompileBundledFiles: true, compilerOptions: {noEmit: false, module: 'esnext', declaration: false}} },
20+
{ test: /\.tsx?$/, loader: 'ts-loader', options: {onlyCompileBundledFiles: true, compilerOptions: {noEmit: false, module: 'esnext', sourceMap: true}} },
2121
{ test: /\.js$/, loader: 'source-map-loader' },
2222
{ test: /\.(html|css|png)$/, loader: 'file-loader', options: {name: '[name].[ext]'} }
2323
]

packages/react-form-with-constraints-bootstrap4/rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default {
3434
typescript({
3535
abortOnError: false,
3636
clean: true,
37-
tsconfigOverride: {compilerOptions: {noEmit: false, module: 'esnext', declaration: false}}
37+
tsconfigOverride: {compilerOptions: {noEmit: false, module: 'esnext'}}
3838
}),
3939
__PROD__ && uglify(),
4040
gzip({algorithm: 'zopfli'}),

packages/react-form-with-constraints-bootstrap4/tsconfig.lib.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
"extends": "./tsconfig",
33
"compilerOptions": {
44
"noEmit": false,
5-
"outDir": "lib"
5+
"outDir": "lib",
6+
"inlineSourceMap": true,
7+
"inlineSources": true,
8+
"declaration": true
69
},
710
"include": []
811
}

0 commit comments

Comments
 (0)