diff --git a/packages/webpack5/__tests__/configuration/__snapshots__/javascript.spec.ts.snap b/packages/webpack5/__tests__/configuration/__snapshots__/javascript.spec.ts.snap index 22ba2df014..0f70b870de 100644 --- a/packages/webpack5/__tests__/configuration/__snapshots__/javascript.spec.ts.snap +++ b/packages/webpack5/__tests__/configuration/__snapshots__/javascript.spec.ts.snap @@ -85,27 +85,6 @@ exports[`javascript configuration for android 1`] = ` } ] }, - /* config.module.rule('ts') */ - { - test: [ - /\\\\.ts$/ - ], - use: [ - /* config.module.rule('ts').use('ts-loader') */ - { - loader: 'ts-loader', - options: { - transpileOnly: true, - allowTsInNodeModules: true, - compilerOptions: { - sourceMap: true, - declaration: false - }, - getCustomTransformers: function () { /* omitted long function */ } - } - } - ] - }, /* config.module.rule('js') */ { test: /\\\\.js$/, @@ -408,27 +387,6 @@ exports[`javascript configuration for ios 1`] = ` } ] }, - /* config.module.rule('ts') */ - { - test: [ - /\\\\.ts$/ - ], - use: [ - /* config.module.rule('ts').use('ts-loader') */ - { - loader: 'ts-loader', - options: { - transpileOnly: true, - allowTsInNodeModules: true, - compilerOptions: { - sourceMap: true, - declaration: false - }, - getCustomTransformers: function () { /* omitted long function */ } - } - } - ] - }, /* config.module.rule('js') */ { test: /\\\\.js$/, diff --git a/packages/webpack5/src/configuration/javascript.ts b/packages/webpack5/src/configuration/javascript.ts index 914036eb2f..c5004127f0 100644 --- a/packages/webpack5/src/configuration/javascript.ts +++ b/packages/webpack5/src/configuration/javascript.ts @@ -22,6 +22,9 @@ export default function (config: Config, env: IWebpackEnv = _env): Config { // VIRTUAL ENTRY END ` ); + + // remove default ts rule + config.module.rules.delete('ts'); // exclude files starting with _ from require.context config