Skip to content

Commit 8d4d501

Browse files
committed
run babel-loader + fork ts check when NOT in CI, otherwise use ts-loader for tsx files
1 parent 3bac7fb commit 8d4d501

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

webpack.config.js

+23-13
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const SENTRY_WEBPACK_PROXY_PORT = env.SENTRY_WEBPACK_PROXY_PORT;
3030
const USE_HOT_MODULE_RELOAD =
3131
!IS_PRODUCTION && SENTRY_BACKEND_PORT && SENTRY_WEBPACK_PROXY_PORT;
3232
const NO_DEV_SERVER = env.NO_DEV_SERVER;
33+
const IS_CI = !!env.CI || !!env.TRAVIS;
3334

3435
// Deploy previews are built using netlify. We can check if we're in netlifys
3536
// build process by checking the existence of the PULL_REQUEST env var.
@@ -224,16 +225,21 @@ let appConfig = {
224225
include: [staticPrefix],
225226
exclude: /(vendor|node_modules|dist)/,
226227
use: [
227-
{
228-
loader: 'babel-loader',
229-
options: babelOptions,
230-
},
231-
{
232-
loader: 'ts-loader',
233-
options: {
234-
transpileOnly: true,
235-
},
236-
},
228+
...(!IS_CI
229+
? [
230+
{
231+
loader: 'babel-loader',
232+
options: babelOptions,
233+
},
234+
]
235+
: [
236+
{
237+
loader: 'ts-loader',
238+
options: {
239+
transpileOnly: false,
240+
},
241+
},
242+
]),
237243
],
238244
},
239245
{
@@ -318,9 +324,13 @@ let appConfig = {
318324
*/
319325
new FixStyleOnlyEntriesPlugin(),
320326

321-
new ForkTsCheckerWebpackPlugin({
322-
tsconfig: path.resolve(__dirname, './tsconfig.json'),
323-
}),
327+
...(!IS_CI
328+
? [
329+
new ForkTsCheckerWebpackPlugin({
330+
tsconfig: path.resolve(__dirname, './tsconfig.json'),
331+
}),
332+
]
333+
: []),
324334

325335
...localeRestrictionPlugins,
326336
],

0 commit comments

Comments
 (0)