Kean Mariotti | 0610eb8 | 2022-06-08 16:39:43 +0000 | [diff] [blame] | 1 | /* |
| 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 Mariotti | 73be978 | 2022-12-30 11:12:27 +0000 | [diff] [blame] | 16 | const {merge} = require('webpack-merge'); |
| 17 | const configCommon = require('./webpack.config.common'); |
| 18 | const HtmlWebpackPlugin = require('html-webpack-plugin'); |
Kean Mariotti | ce1c4a4 | 2023-06-15 15:16:28 +0000 | [diff] [blame] | 19 | const CopyPlugin = require('copy-webpack-plugin'); |
Kean Mariotti | 0610eb8 | 2022-06-08 16:39:43 +0000 | [diff] [blame] | 20 | |
| 21 | const configDev = { |
Kean Mariotti | 73be978 | 2022-12-30 11:12:27 +0000 | [diff] [blame] | 22 | mode: 'development', |
Kean Mariotti | 7f1e9e3 | 2022-07-05 08:37:29 +0000 | [diff] [blame] | 23 | entry: { |
Kean Mariotti | 73be978 | 2022-12-30 11:12:27 +0000 | [diff] [blame] | 24 | polyfills: './src/polyfills.ts', |
| 25 | styles: ['./src/material-theme.scss', './src/styles.css'], |
Kean Mariotti | 9ffaca7 | 2023-01-04 08:40:48 +0000 | [diff] [blame] | 26 | app: './src/main_dev.ts', |
Kean Mariotti | 7f1e9e3 | 2022-07-05 08:37:29 +0000 | [diff] [blame] | 27 | }, |
Kean Mariotti | 73be978 | 2022-12-30 11:12:27 +0000 | [diff] [blame] | 28 | devtool: 'source-map', |
Kean Mariotti | ce1c4a4 | 2023-06-15 15:16:28 +0000 | [diff] [blame] | 29 | |
| 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 Mariotti | 5a86978 | 2022-11-30 16:27:20 +0000 | [diff] [blame] | 42 | plugins: [ |
| 43 | new HtmlWebpackPlugin({ |
Kean Mariotti | 73be978 | 2022-12-30 11:12:27 +0000 | [diff] [blame] | 44 | template: 'src/index.html', |
| 45 | inject: 'body', |
| 46 | inlineSource: '.(css|js)$', |
| 47 | }), |
Kean Mariotti | ce1c4a4 | 2023-06-15 15:16:28 +0000 | [diff] [blame] | 48 | 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', |
Priyanka | 671247a | 2023-09-25 15:37:54 +0000 | [diff] [blame] | 52 | {from: 'src/adb/winscope_proxy.py', to: 'winscope_proxy.py'}, |
Kean Mariotti | ce1c4a4 | 2023-06-15 15:16:28 +0000 | [diff] [blame] | 53 | ], |
| 54 | }), |
Kean Mariotti | 73be978 | 2022-12-30 11:12:27 +0000 | [diff] [blame] | 55 | ], |
Kean Mariotti | 0610eb8 | 2022-06-08 16:39:43 +0000 | [diff] [blame] | 56 | }; |
| 57 | |
| 58 | module.exports = merge(configCommon, configDev); |