mirror of https://github.com/apache/superset.git
feat(ui): Adding manifest prefix config (#19141)
* Adding manifest prefix config * Fixing broken tests * Fixing import * Adding prefix for remaining assets * Changing static prefix strategy * Fixing DST test * Fixing up formatting * Fixing up async_query_manager.py types
This commit is contained in:
parent
02ef9ca4cd
commit
4b34817b19
|
@ -95,10 +95,10 @@ const plugins = [
|
|||
entryFiles[entry] = {
|
||||
css: chunks
|
||||
.filter(x => x.endsWith('.css'))
|
||||
.map(x => path.join(output.publicPath, x)),
|
||||
.map(x => `${output.publicPath}${x}`),
|
||||
js: chunks
|
||||
.filter(x => x.endsWith('.js'))
|
||||
.map(x => path.join(output.publicPath, x)),
|
||||
.map(x => `${output.publicPath}${x}`),
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ from superset.exceptions import (
|
|||
QueryObjectValidationError,
|
||||
)
|
||||
from superset.sql_parse import validate_filter_clause
|
||||
from superset.typing import Column, Metric, OrderBy
|
||||
from superset.superset_typing import Column, Metric, OrderBy
|
||||
from superset.utils import pandas_postprocessing
|
||||
from superset.utils.core import (
|
||||
DTTM_ALIAS,
|
||||
|
|
|
@ -46,7 +46,7 @@ from superset.constants import CHANGE_ME_SECRET_KEY
|
|||
from superset.jinja_context import BaseTemplateProcessor
|
||||
from superset.key_value.types import KeyType
|
||||
from superset.stats_logger import DummyStatsLogger
|
||||
from superset.typing import CacheConfig
|
||||
from superset.superset_typing import CacheConfig
|
||||
from superset.utils.core import is_test, parse_boolean_string
|
||||
from superset.utils.encrypt import SQLAlchemyUtilsAdapter
|
||||
from superset.utils.log import DBEventLogger
|
||||
|
@ -1252,6 +1252,10 @@ SEND_FILE_MAX_AGE_DEFAULT = int(timedelta(days=365).total_seconds())
|
|||
# SQLALCHEMY_DATABASE_URI by default if set to `None`
|
||||
SQLALCHEMY_EXAMPLES_URI = None
|
||||
|
||||
# Optional prefix to be added to all static asset paths when rendering the UI.
|
||||
# This is useful for hosting assets in an external CDN, for example
|
||||
STATIC_ASSETS_PREFIX = ""
|
||||
|
||||
# Some sqlalchemy connection strings can open Superset to security risks.
|
||||
# Typically these should not be allowed.
|
||||
PREVENT_UNSAFE_DB_CONNECTIONS = True
|
||||
|
|
|
@ -29,7 +29,7 @@ from superset.constants import EMPTY_STRING, NULL_STRING
|
|||
from superset.datasets.commands.exceptions import DatasetNotFoundError
|
||||
from superset.models.helpers import AuditMixinNullable, ImportExportMixin, QueryResult
|
||||
from superset.models.slice import Slice
|
||||
from superset.typing import FilterValue, FilterValues, QueryObjectDict
|
||||
from superset.superset_typing import FilterValue, FilterValues, QueryObjectDict
|
||||
from superset.utils import core as utils
|
||||
from superset.utils.core import GenericDataType
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ from superset.exceptions import SupersetException
|
|||
from superset.extensions import encrypted_field_factory
|
||||
from superset.models.core import Database
|
||||
from superset.models.helpers import AuditMixinNullable, ImportExportMixin, QueryResult
|
||||
from superset.typing import (
|
||||
from superset.superset_typing import (
|
||||
AdhocMetric,
|
||||
AdhocMetricColumn,
|
||||
FilterValues,
|
||||
|
|
|
@ -34,7 +34,7 @@ from superset.connectors.base.views import BS3TextFieldROWidget, DatasourceModel
|
|||
from superset.connectors.connector_registry import ConnectorRegistry
|
||||
from superset.connectors.druid import models
|
||||
from superset.constants import RouteMethod
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.superset_typing import FlaskResponse
|
||||
from superset.utils import core as utils
|
||||
from superset.views.base import (
|
||||
BaseSupersetView,
|
||||
|
|
|
@ -96,8 +96,14 @@ from superset.models.helpers import (
|
|||
QueryResult,
|
||||
)
|
||||
from superset.sql_parse import ParsedQuery
|
||||
from superset.superset_typing import (
|
||||
AdhocColumn,
|
||||
AdhocMetric,
|
||||
Metric,
|
||||
OrderBy,
|
||||
QueryObjectDict,
|
||||
)
|
||||
from superset.tables.models import Table as NewTable
|
||||
from superset.typing import AdhocColumn, AdhocMetric, Metric, OrderBy, QueryObjectDict
|
||||
from superset.utils import core as utils
|
||||
from superset.utils.core import (
|
||||
GenericDataType,
|
||||
|
|
|
@ -36,7 +36,7 @@ from superset import app, db, is_feature_enabled
|
|||
from superset.connectors.base.views import DatasourceModelView
|
||||
from superset.connectors.sqla import models
|
||||
from superset.constants import MODEL_VIEW_RW_METHOD_PERMISSION_MAP, RouteMethod
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.superset_typing import FlaskResponse
|
||||
from superset.utils import core as utils
|
||||
from superset.views.base import (
|
||||
check_ownership,
|
||||
|
|
|
@ -70,7 +70,7 @@ from superset.db_engine_specs import get_available_engine_specs
|
|||
from superset.errors import ErrorLevel, SupersetError, SupersetErrorType
|
||||
from superset.extensions import security_manager
|
||||
from superset.models.core import Database
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.superset_typing import FlaskResponse
|
||||
from superset.utils.core import error_msg_from_exception
|
||||
from superset.views.base_api import (
|
||||
BaseSupersetModelRestApi,
|
||||
|
|
|
@ -63,22 +63,26 @@ class UIManifestProcessor:
|
|||
self.app = app
|
||||
# Preload the cache
|
||||
self.parse_manifest_json()
|
||||
self.register_processor(app)
|
||||
|
||||
@app.context_processor
|
||||
def get_manifest() -> Dict[str, Callable[[str], List[str]]]:
|
||||
loaded_chunks = set()
|
||||
def register_processor(self, app: Flask) -> None:
|
||||
app.template_context_processors[None].append(self.get_manifest)
|
||||
|
||||
def get_files(bundle: str, asset_type: str = "js") -> List[str]:
|
||||
files = self.get_manifest_files(bundle, asset_type)
|
||||
filtered_files = [f for f in files if f not in loaded_chunks]
|
||||
for f in filtered_files:
|
||||
loaded_chunks.add(f)
|
||||
return filtered_files
|
||||
def get_manifest(self) -> Dict[str, Callable[[str], List[str]]]:
|
||||
loaded_chunks = set()
|
||||
|
||||
return dict(
|
||||
js_manifest=lambda bundle: get_files(bundle, "js"),
|
||||
css_manifest=lambda bundle: get_files(bundle, "css"),
|
||||
)
|
||||
def get_files(bundle: str, asset_type: str = "js") -> List[str]:
|
||||
files = self.get_manifest_files(bundle, asset_type)
|
||||
filtered_files = [f for f in files if f not in loaded_chunks]
|
||||
for f in filtered_files:
|
||||
loaded_chunks.add(f)
|
||||
return filtered_files
|
||||
|
||||
return dict(
|
||||
js_manifest=lambda bundle: get_files(bundle, "js"),
|
||||
css_manifest=lambda bundle: get_files(bundle, "css"),
|
||||
assets_prefix=self.app.config["STATIC_ASSETS_PREFIX"] if self.app else "",
|
||||
)
|
||||
|
||||
def parse_manifest_json(self) -> None:
|
||||
try:
|
||||
|
|
|
@ -49,7 +49,7 @@ from superset.extensions import (
|
|||
talisman,
|
||||
)
|
||||
from superset.security import SupersetSecurityManager
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.superset_typing import FlaskResponse
|
||||
from superset.utils.core import pessimistic_connection_handling
|
||||
from superset.utils.log import DBEventLogger, get_event_logger_from_cfg_value
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import pandas as pd
|
|||
import pyarrow as pa
|
||||
|
||||
from superset.db_engine_specs import BaseEngineSpec
|
||||
from superset.typing import DbapiDescription, DbapiResult
|
||||
from superset.superset_typing import DbapiDescription, DbapiResult
|
||||
from superset.utils import core as utils
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
{% block head_css %}
|
||||
{{ super() }}
|
||||
<link rel="icon" type="image/png" href="/static/assets/images/favicon.png">
|
||||
<link rel="icon" type="image/png" href="{{ assets_prefix }}/static/assets/images/favicon.png">
|
||||
{{ css_bundle("theme") }}
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -40,11 +40,11 @@
|
|||
rel="{{favicon.rel if favicon.rel else "icon"}}"
|
||||
type="{{favicon.type if favicon.type else "image/png"}}"
|
||||
{% if favicon.sizes %}sizes={{favicon.sizes}}{% endif %}
|
||||
href="{{favicon.href}}"
|
||||
href="{{ assets_prefix }}{{favicon.href}}"
|
||||
>
|
||||
{% endfor %}
|
||||
<link rel="stylesheet" type="text/css" href="/static/appbuilder/css/flags/flags16.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/static/appbuilder/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="{{ assets_prefix }}/static/appbuilder/css/flags/flags16.css" />
|
||||
<link rel="stylesheet" type="text/css" href="{{ assets_prefix }}/static/appbuilder/css/font-awesome.min.css">
|
||||
|
||||
{{ css_bundle("theme") }}
|
||||
|
||||
|
@ -73,7 +73,7 @@
|
|||
|
||||
{% block body %}
|
||||
<div id="app" data-bootstrap="{{ bootstrap_data }}">
|
||||
<img src="/static/assets/images/loading.gif" style="width: 50px; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%)">
|
||||
<img src="{{ assets_prefix }}/static/assets/images/loading.gif" style="width: 50px; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%)">
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -1342,5 +1342,5 @@
|
|||
{{ super() }}
|
||||
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
||||
<script src="/static/assets/stylesheets/less/cosmo/cosmoTheme.js"></script>
|
||||
<script src="{{ assets_prefix }}/static/assets/stylesheets/less/cosmo/cosmoTheme.js"></script>
|
||||
{% endblock %}
|
||||
|
|
|
@ -98,7 +98,7 @@ from superset.exceptions import (
|
|||
SupersetException,
|
||||
SupersetTimeoutException,
|
||||
)
|
||||
from superset.typing import (
|
||||
from superset.superset_typing import (
|
||||
AdhocColumn,
|
||||
AdhocMetric,
|
||||
AdhocMetricColumn,
|
||||
|
|
|
@ -30,8 +30,8 @@ from werkzeug.exceptions import NotFound
|
|||
from superset import is_feature_enabled
|
||||
from superset.constants import RouteMethod
|
||||
from superset.models.alerts import Alert, AlertLog, SQLObservation
|
||||
from superset.superset_typing import FlaskResponse
|
||||
from superset.tasks.alerts.validator import check_validator
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.utils import core as utils
|
||||
from superset.utils.core import get_email_address_str, markdown
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ from wtforms.validators import StopValidation
|
|||
from superset import is_feature_enabled
|
||||
from superset.constants import MODEL_VIEW_RW_METHOD_PERMISSION_MAP, RouteMethod
|
||||
from superset.models.annotations import Annotation, AnnotationLayer
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.superset_typing import FlaskResponse
|
||||
from superset.views.base import SupersetModelView
|
||||
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ from superset.charts.commands.exceptions import (
|
|||
)
|
||||
from superset.legacy import update_time_range
|
||||
from superset.models.slice import Slice
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.superset_typing import FlaskResponse
|
||||
from superset.utils import core as utils
|
||||
from superset.utils.date_parser import get_since_until
|
||||
from superset.views.base import api, BaseSupersetView, handle_api_exception
|
||||
|
|
|
@ -73,8 +73,8 @@ from superset.exceptions import (
|
|||
)
|
||||
from superset.models.helpers import ImportExportMixin
|
||||
from superset.models.reports import ReportRecipientType
|
||||
from superset.superset_typing import FlaskResponse
|
||||
from superset.translations.utils import get_language_pack
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.utils import core as utils
|
||||
|
||||
from .utils import bootstrap_user_data
|
||||
|
|
|
@ -37,7 +37,7 @@ from superset.models.slice import Slice
|
|||
from superset.schemas import error_payload_content
|
||||
from superset.sql_lab import Query as SqllabQuery
|
||||
from superset.stats_logger import BaseStatsLogger
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.superset_typing import FlaskResponse
|
||||
from superset.utils.core import time_function
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
|
@ -24,7 +24,7 @@ from flask_babel import lazy_gettext as _
|
|||
from superset import is_feature_enabled
|
||||
from superset.constants import MODEL_VIEW_RW_METHOD_PERMISSION_MAP, RouteMethod
|
||||
from superset.models.slice import Slice
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.superset_typing import FlaskResponse
|
||||
from superset.utils import core as utils
|
||||
from superset.views.base import (
|
||||
check_ownership,
|
||||
|
|
|
@ -123,8 +123,8 @@ from superset.sqllab.sql_json_executer import (
|
|||
from superset.sqllab.sqllab_execution_context import SqlJsonExecutionContext
|
||||
from superset.sqllab.utils import apply_display_max_row_configuration_if_require
|
||||
from superset.sqllab.validators import CanAccessQueryValidatorImpl
|
||||
from superset.superset_typing import FlaskResponse
|
||||
from superset.tasks.async_queries import load_explore_json_into_cache
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.utils import core as utils, csv
|
||||
from superset.utils.async_query_manager import AsyncQueryTokenException
|
||||
from superset.utils.cache import etag_cache
|
||||
|
|
|
@ -22,7 +22,7 @@ from flask_babel import lazy_gettext as _
|
|||
from superset import is_feature_enabled
|
||||
from superset.constants import MODEL_VIEW_RW_METHOD_PERMISSION_MAP, RouteMethod
|
||||
from superset.models import core as models
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.superset_typing import FlaskResponse
|
||||
from superset.views.base import DeleteMixin, SupersetModelView
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ from flask_login import AnonymousUserMixin, LoginManager
|
|||
from superset import db, event_logger, is_feature_enabled, security_manager
|
||||
from superset.constants import MODEL_VIEW_RW_METHOD_PERMISSION_MAP, RouteMethod
|
||||
from superset.models.dashboard import Dashboard as DashboardModel
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.superset_typing import FlaskResponse
|
||||
from superset.utils import core as utils
|
||||
from superset.views.base import (
|
||||
BaseSupersetView,
|
||||
|
|
|
@ -37,7 +37,7 @@ from superset.constants import MODEL_VIEW_RW_METHOD_PERMISSION_MAP, RouteMethod
|
|||
from superset.exceptions import CertificateException
|
||||
from superset.extensions import event_logger
|
||||
from superset.sql_parse import Table
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.superset_typing import FlaskResponse
|
||||
from superset.utils import core as utils
|
||||
from superset.views.base import DeleteMixin, SupersetModelView, YamlExportMixin
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ from superset.datasets.commands.exceptions import (
|
|||
from superset.exceptions import SupersetException, SupersetSecurityException
|
||||
from superset.extensions import security_manager
|
||||
from superset.models.core import Database
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.superset_typing import FlaskResponse
|
||||
from superset.views.base import (
|
||||
api,
|
||||
BaseSupersetView,
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from superset import app, talisman
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.superset_typing import FlaskResponse
|
||||
|
||||
|
||||
@talisman(force_https=False)
|
||||
|
|
|
@ -23,7 +23,7 @@ from werkzeug.exceptions import NotFound
|
|||
|
||||
from superset import db, event_logger, is_feature_enabled
|
||||
from superset.models import core as models
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.superset_typing import FlaskResponse
|
||||
from superset.utils import core as utils
|
||||
from superset.views.base import BaseSupersetView, json_error_response
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ from werkzeug.utils import redirect
|
|||
|
||||
from superset import db, event_logger
|
||||
from superset.models import core as models
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.superset_typing import FlaskResponse
|
||||
from superset.views.base import BaseSupersetView
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
|
@ -42,8 +42,8 @@ from superset.models.schedules import (
|
|||
SliceEmailSchedule,
|
||||
)
|
||||
from superset.models.slice import Slice
|
||||
from superset.superset_typing import FlaskResponse
|
||||
from superset.tasks.schedules import schedule_email_report
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.utils.core import get_email_address_list, json_iso_dttm_ser
|
||||
from superset.views.core import json_success
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ from flask_babel import lazy_gettext as _
|
|||
from superset import db, is_feature_enabled
|
||||
from superset.constants import MODEL_VIEW_RW_METHOD_PERMISSION_MAP, RouteMethod
|
||||
from superset.models.sql_lab import Query, SavedQuery, TableSchema, TabState
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.superset_typing import FlaskResponse
|
||||
from superset.utils import core as utils
|
||||
|
||||
from .base import BaseSupersetView, DeleteMixin, json_success, SupersetModelView
|
||||
|
|
|
@ -33,7 +33,7 @@ from superset.models.dashboard import Dashboard
|
|||
from superset.models.slice import Slice
|
||||
from superset.models.sql_lab import SavedQuery
|
||||
from superset.models.tags import ObjectTypes, Tag, TaggedObject, TagTypes
|
||||
from superset.typing import FlaskResponse
|
||||
from superset.superset_typing import FlaskResponse
|
||||
|
||||
from .base import BaseSupersetView, json_success
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ from superset.models.core import Database
|
|||
from superset.models.dashboard import Dashboard
|
||||
from superset.models.slice import Slice
|
||||
from superset.models.sql_lab import Query
|
||||
from superset.typing import FormData
|
||||
from superset.superset_typing import FormData
|
||||
from superset.utils.decorators import stats_timing
|
||||
from superset.viz import BaseViz
|
||||
|
||||
|
|
|
@ -70,7 +70,13 @@ from superset.exceptions import (
|
|||
from superset.extensions import cache_manager, security_manager
|
||||
from superset.models.helpers import QueryResult
|
||||
from superset.sql_parse import validate_filter_clause
|
||||
from superset.typing import Column, Metric, QueryObjectDict, VizData, VizPayload
|
||||
from superset.superset_typing import (
|
||||
Column,
|
||||
Metric,
|
||||
QueryObjectDict,
|
||||
VizData,
|
||||
VizPayload,
|
||||
)
|
||||
from superset.utils import core as utils, csv
|
||||
from superset.utils.cache import set_and_log_cache
|
||||
from superset.utils.core import (
|
||||
|
|
|
@ -47,7 +47,7 @@ from superset.errors import SupersetErrorType
|
|||
from superset.extensions import async_query_manager, db
|
||||
from superset.models.annotations import AnnotationLayer
|
||||
from superset.models.slice import Slice
|
||||
from superset.typing import AdhocColumn
|
||||
from superset.superset_typing import AdhocColumn
|
||||
from superset.utils.core import (
|
||||
AnnotationType,
|
||||
get_example_default_schema,
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
# under the License.
|
||||
# pylint: disable=unused-argument, import-outside-toplevel
|
||||
from superset.dataframe import df_to_records
|
||||
from superset.typing import DbapiDescription
|
||||
from superset.superset_typing import DbapiDescription
|
||||
|
||||
|
||||
def test_df_to_records(app_context: None) -> None:
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you 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.
|
||||
from os.path import dirname
|
||||
from unittest.mock import Mock
|
||||
|
||||
from superset.extensions import UIManifestProcessor
|
||||
|
||||
APP_DIR = f"{dirname(__file__)}/fixtures"
|
||||
|
||||
|
||||
def test_get_manifest_with_prefix():
|
||||
app = Mock(
|
||||
config={"STATIC_ASSETS_PREFIX": "https://cool.url/here"},
|
||||
template_context_processors={None: []},
|
||||
)
|
||||
manifest_processor = UIManifestProcessor(APP_DIR)
|
||||
manifest_processor.init_app(app)
|
||||
manifest = manifest_processor.get_manifest()
|
||||
assert manifest["js_manifest"]("main") == ["/static/dist/main-js.js"]
|
||||
assert manifest["css_manifest"]("main") == ["/static/dist/main-css.css"]
|
||||
assert manifest["js_manifest"]("styles") == ["/static/dist/styles-js.js"]
|
||||
assert manifest["css_manifest"]("styles") == []
|
||||
assert manifest["assets_prefix"] == "https://cool.url/here"
|
||||
|
||||
|
||||
def test_get_manifest_no_prefix():
|
||||
app = Mock(
|
||||
config={"STATIC_ASSETS_PREFIX": ""}, template_context_processors={None: []}
|
||||
)
|
||||
manifest_processor = UIManifestProcessor(APP_DIR)
|
||||
manifest_processor.init_app(app)
|
||||
manifest = manifest_processor.get_manifest()
|
||||
assert manifest["js_manifest"]("main") == ["/static/dist/main-js.js"]
|
||||
assert manifest["css_manifest"]("main") == ["/static/dist/main-css.css"]
|
||||
assert manifest["js_manifest"]("styles") == ["/static/dist/styles-js.js"]
|
||||
assert manifest["css_manifest"]("styles") == []
|
||||
assert manifest["assets_prefix"] == ""
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"entrypoints": {
|
||||
"styles": {
|
||||
"js": [
|
||||
"/static/dist/styles-js.js"
|
||||
]
|
||||
},
|
||||
"main": {
|
||||
"css": [
|
||||
"/static/dist/main-css.css"
|
||||
],
|
||||
"js": [
|
||||
"/static/dist/main-js.js"
|
||||
]
|
||||
}
|
||||
},
|
||||
"main.css": "/static/dist/main.b51d3f6225194da423d6.entry.css",
|
||||
"main.js": "/static/dist/main.b51d3f6225194da423d6.entry.js",
|
||||
"styles.js": "/static/dist/styles.35840b4bbf794f902b7c.entry.js"
|
||||
}
|
Loading…
Reference in New Issue