• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16const { initConfig } = require('./lib/fast_build/common/init_config');
17const { getCleanConfig } = require('./main');
18const { etsTransform } = require('./lib/fast_build/ets_ui/rollup-plugin-ets-typescript');
19const { etsChecker } = require('./lib/fast_build/ets_ui/rollup-plugin-ets-checker');
20const { apiTransform } = require('./lib/fast_build/system_api/rollup-plugin-system-api');
21const { genAbc } = require('./lib/fast_build/ark_compiler/rollup-plugin-gen-abc');
22const { watchChangeFiles } = require('./lib/fast_build/common/rollup-plugin-watch-change');
23const { visualTransform } = require('./lib/fast_build/visual/rollup-plugin-visual');
24const { terserPlugin } = require('./lib/fast_build/ark_compiler/terser-plugin');
25const { babelPlugin } = require('./lib/fast_build/ark_compiler/babel-plugin');
26const { JSBUNDLE, RELEASE } = require('./lib/fast_build/ark_compiler/common/ark_define');
27
28exports.initConfig = initConfig;
29exports.getCleanConfig = getCleanConfig;
30
31// list of functional plugins
32exports.sdkPlugins = (projectConfig) => {
33    return [
34        watchChangeFiles(),
35        etsChecker(),
36        visualTransform(),
37        etsTransform(),
38        apiTransform(),
39        genAbc(),
40        projectConfig.buildMode?.toLowerCase() === RELEASE && terserPlugin(),
41        projectConfig.compileMode === JSBUNDLE && babelPlugin(projectConfig)
42    ];
43};
44exports.sdkPluginsMap = {
45    "watchChangeFiles": 0,
46    "etsChecker": 1,
47    "visualTransform": 2,
48    "etsTransform": 3,
49    "apiTransform": 4,
50    "genAbc": 5,
51    "terserPlugin": 6,
52    "babelPlugin": 7,
53};
54
55exports.resolveFileExtensions = [];
56