enable Angular production mode
Test: npm run build:prod Change-Id: Iadfe6f81b0cfb611aa6b9266a08424927d82c5d1
This commit is contained in:
20
tools/winscope-ng/src/main.dev.ts
Normal file
20
tools/winscope-ng/src/main.dev.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (C) 2022 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import {platformBrowserDynamic} from "@angular/platform-browser-dynamic";
|
||||
import {AppModule} from "./app/app.module";
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule)
|
||||
.catch(err => console.error(err));
|
||||
@@ -13,23 +13,11 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import {enableProdMode} from "@angular/core";
|
||||
import {platformBrowserDynamic} from "@angular/platform-browser-dynamic";
|
||||
import {AppModule} from "./app/app.module";
|
||||
|
||||
/*
|
||||
* For easier debugging in development mode, you can import the following file
|
||||
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
|
||||
*
|
||||
* This import should be commented out in production mode because it will have a negative impact
|
||||
* on performance if an error is thrown.
|
||||
*/
|
||||
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
|
||||
|
||||
import { enableProdMode } from '@angular/core';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app/app.module';
|
||||
|
||||
//TODO: implement production mode switch
|
||||
//enableProdMode();
|
||||
enableProdMode();
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule)
|
||||
.catch(err => console.error(err));
|
||||
@@ -17,11 +17,6 @@ const path = require('path');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
polyfills: "./src/polyfills.ts",
|
||||
app: "./src/main.ts"
|
||||
},
|
||||
|
||||
resolve: {
|
||||
extensions: [".ts", ".js"],
|
||||
modules: [
|
||||
|
||||
@@ -18,6 +18,10 @@ const configCommon = require('./webpack.config.common');
|
||||
|
||||
const configDev = {
|
||||
mode: 'development',
|
||||
entry: {
|
||||
polyfills: "./src/polyfills.ts",
|
||||
app: "./src/main.dev.ts"
|
||||
},
|
||||
devtool: "source-map",
|
||||
};
|
||||
|
||||
|
||||
@@ -21,6 +21,10 @@ const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin
|
||||
|
||||
const configProd = {
|
||||
mode: 'production',
|
||||
entry: {
|
||||
polyfills: "./src/polyfills.ts",
|
||||
app: "./src/main.prod.ts"
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
publicPath: '/',
|
||||
|
||||
Reference in New Issue
Block a user