我有一个我开发的angular 8应用程序,所有组件的CSS都在每个组件的对应位置。
当我运行ng时,所有CSS渲染都可以在需要的地方正确显示。
但是,无论何时我在将这些文件部署到url之后运行ng build --prod来准备要托管的文件时,每个组件的使用率都为10%-20%,这会抛出我所有的div和样式,并导致糟糕的用户经验。
我运行了--prod --extractCss = false,然后部署了这些文件,并且发生了相同的问题。
有没有人可以建议让ng build --prod命令像ng带有某些标志的服务那样运行,或者我可以尝试解决的CSS路径问题。
非常感谢您的帮助!
更新:刚刚运行了“ ng build --prod --aot = false --output-hashing = media --sourceMap = true --extract-css = false --buildOptimizer = false”
那仍然不能解决问题。几乎就像CSS只是放大10%,足以抛弃我所有的div,填充等。
示例:在使用ng serve运行时没有滚动功能的页面上,从上方运行ng buld --prod命令(包括所有标志)后,该页面现在具有滚动功能
答案 0 :(得分:1)
根据Angular-cli的github Wiki v2 +,这是启动开发和生产版本的最常见方式
with cte_1(
SELECT ,partition_date
,store_id
,merchant_id
,count(product_id) as count_product_id_per_merchant
FROM main_table
GROUP BY 1,2,3),
cte_2 as(
SELECT partition_date
,merchant_id
,max(count_product_id_per_merchant) AS max_product_id_count
,min(count_product_id_per_merchant) AS min_product_id_count
FROM cte_1
GROUP BY 1,2),
cte_3 as (
SELECT partition_date
,merchant_id
,(max_product_id_count - min_product_id_count) count_shared_productID_per_merchant
FROM cte_2),
cte_4 as (
SELECT partition_date
,product_id
,store_id
,merchant_id
,usage_status
, row_number() over (partition by merchant_id, store_id order by merchant_id, store_id, usgae_status as product_rn
from main_table),
cte_5 as(
SELECT cte_4.partition_date
,cte_4.product_id
,cte_4.merchant_id
, cte_4.usage_status
,cte_4.product_rn
, CASE WHEN cte_4.product_rn <= cte_3.count_shared_productID_per_merchant AND cte_4.store_id = 'store_1' THEN 'shared_products'
WHEN cte_4.product_rn > cte_3.count_shared_productID_per_merchant AND cte_4.store_id = 'store_2' THEN 'exclusive_product_store_2'
WHEN cte_4.product_rn > cte_3.count_shared_productID_per_merchant AND cte_4.store_id = 'store_1' THEN 'exclusive_product_store_1'
ELSE NULL END AS product_category
FROM cte_4
LEFT JOIN cte_3 on cte_4.merchant_id = cte_3.merchant_id)
SELECT cte_4.merchant_id
,cte_4.partition_date
,cte_4.usage_status
,cte_4.product_category
,count(article_id) as Count_product_id
FROM cte_4
LEFT JOIM main_table mt ON mt.merchant_id 0N cte_4.merchant_id
GROUP BY 1,2,3,4
```