Skip to content

Commit 01ec7be

Browse files
author
chengyu.chengyulia
committed
fix: babel-loader options
1 parent 940e817 commit 01ec7be

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/utils/babel-options.ts

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export function getBabelOptions(options?: Partial<DefaultOptions>) {
3131
return {
3232
babelrc: false,
3333
comments: globalState.isDevelopment,
34-
cacheDirectory: true,
3534
presets: [[babelPresetEnv, { modules: mergedOptions.modules }], [babelPresetReact], [babelPresetTypescript]],
3635
plugins: [
3736
[transformRuntime],

src/utils/webpack-config.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,12 @@ export const getWebpackConfig = async (opts: IOptions) => {
132132

133133
const babelLoader = {
134134
loader: 'babel-loader',
135-
options: plugin.buildConfigBabelLoaderOptionsPipes.reduce((options, fn) => {
136-
return fn(options);
137-
}, getBabelOptions()),
135+
options: plugin.buildConfigBabelLoaderOptionsPipes.reduce(
136+
(options, fn) => {
137+
return fn(options);
138+
},
139+
{ ...getBabelOptions(), cacheDirectory: true },
140+
),
138141
};
139142

140143
const extraCssInProd = (...loaders: any[]) => {

0 commit comments

Comments
 (0)