107ac75b1Sopenharmony_ci/*
207ac75b1Sopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd.
307ac75b1Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
407ac75b1Sopenharmony_ci * you may not use this file except in compliance with the License.
507ac75b1Sopenharmony_ci * You may obtain a copy of the License at
607ac75b1Sopenharmony_ci *
707ac75b1Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
807ac75b1Sopenharmony_ci *
907ac75b1Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1007ac75b1Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1107ac75b1Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1207ac75b1Sopenharmony_ci * See the License for the specific language governing permissions and
1307ac75b1Sopenharmony_ci * limitations under the License.
1407ac75b1Sopenharmony_ci */
1507ac75b1Sopenharmony_ci
1607ac75b1Sopenharmony_ciimport { getBabelInputPlugin } from '@rollup/plugin-babel';
1707ac75b1Sopenharmony_ciimport {
1807ac75b1Sopenharmony_ci    NODE_MODULES,
1907ac75b1Sopenharmony_ci    OH_MODULES,
2007ac75b1Sopenharmony_ci    OHPM
2107ac75b1Sopenharmony_ci} from './common/ark_define';
2207ac75b1Sopenharmony_ci
2307ac75b1Sopenharmony_ciexport const babelPlugin = (projectConfig: Object): Object => 
2407ac75b1Sopenharmony_ci    getBabelInputPlugin({
2507ac75b1Sopenharmony_ci        extensions: ['.js'],
2607ac75b1Sopenharmony_ci        exclude: [projectConfig.packageManagerType === OHPM ? OH_MODULES : NODE_MODULES],
2707ac75b1Sopenharmony_ci        skipPreflightCheck: true,
2807ac75b1Sopenharmony_ci        babelHelpers: 'runtime',
2907ac75b1Sopenharmony_ci        plugins: [
3007ac75b1Sopenharmony_ci            require('@babel/plugin-proposal-class-properties')
3107ac75b1Sopenharmony_ci        ],
3207ac75b1Sopenharmony_ci        compact: false
3307ac75b1Sopenharmony_ci    });