blob: 9db50119d7b0d26fde4712b0e678a99013e9827c [file] [log] [blame]
Kean Mariotti0610eb82022-06-08 16:39:43 +00001/*
2 * Copyright (C) 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Kean Mariotti73be9782022-12-30 11:12:27 +000016const {merge} = require('webpack-merge');
17const configCommon = require('./webpack.config.common');
18const HtmlWebpackPlugin = require('html-webpack-plugin');
Kean Mariottice1c4a42023-06-15 15:16:28 +000019const CopyPlugin = require('copy-webpack-plugin');
Kean Mariotti0610eb82022-06-08 16:39:43 +000020
21const configDev = {
Kean Mariotti73be9782022-12-30 11:12:27 +000022 mode: 'development',
Kean Mariotti7f1e9e32022-07-05 08:37:29 +000023 entry: {
Kean Mariotti73be9782022-12-30 11:12:27 +000024 polyfills: './src/polyfills.ts',
25 styles: ['./src/material-theme.scss', './src/styles.css'],
Kean Mariotti9ffaca72023-01-04 08:40:48 +000026 app: './src/main_dev.ts',
Kean Mariotti7f1e9e32022-07-05 08:37:29 +000027 },
Kean Mariotti73be9782022-12-30 11:12:27 +000028 devtool: 'source-map',
Kean Mariottice1c4a42023-06-15 15:16:28 +000029
30 externals: {
31 fs: 'fs',
32 path: 'path',
33 crypto: 'crypto',
34 },
35
36 node: {
37 global: false,
38 __filename: false,
39 __dirname: false,
40 },
41
Kean Mariotti5a869782022-11-30 16:27:20 +000042 plugins: [
43 new HtmlWebpackPlugin({
Kean Mariotti73be9782022-12-30 11:12:27 +000044 template: 'src/index.html',
45 inject: 'body',
46 inlineSource: '.(css|js)$',
47 }),
Kean Mariottice1c4a42023-06-15 15:16:28 +000048 new CopyPlugin({
49 patterns: [
50 'deps_build/trace_processor/to_be_served/trace_processor.wasm',
51 'deps_build/trace_processor/to_be_served/engine_bundle.js',
Priyanka671247a2023-09-25 15:37:54 +000052 {from: 'src/adb/winscope_proxy.py', to: 'winscope_proxy.py'},
Kean Mariottice1c4a42023-06-15 15:16:28 +000053 ],
54 }),
Kean Mariotti73be9782022-12-30 11:12:27 +000055 ],
Kean Mariotti0610eb82022-06-08 16:39:43 +000056};
57
58module.exports = merge(configCommon, configDev);