From 30c572e485426b1f72ef33447d8d294f60473689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Fri, 20 Sep 2024 10:38:59 +0200 Subject: [PATCH] fix-alias --- .storybook/main.ts | 3 +++ Makefile | 2 +- buildtools/extract-ngeo-dependencies | 5 +++-- buildtools/webpack.config.dll.js | 10 +++++----- contribs/gmf/apps/desktop_alt/sass/desktop_alt.scss | 2 +- examples/mapillarystreetview.scss | 2 +- src/objectediting/component.js | 4 ++-- tsconfig.json | 3 ++- 8 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index dd6e10a9761a..fee90207ae0a 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -1,4 +1,5 @@ import type {StorybookConfig} from '@storybook/web-components-webpack5'; +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const config: StorybookConfig = { stories: ['../src/**/*.stories.@(ts|tsx)'], @@ -21,12 +22,14 @@ const config: StorybookConfig = { }, webpackFinal: (config) => { + console.log('config.mode:', config.mode); const projectConfig = require('../webpack.config.js')(null, {mode: config.mode}); // Merge some webpack config from the project into the storybook config. const mergedConfig = { ...config, module: {...config.module, rules: projectConfig.module.rules}, + plugins: [...config.plugins, new MiniCssExtractPlugin()], resolve: { ...config.resolve, alias: { diff --git a/Makefile b/Makefile index fb80b2cf7b23..d7b8cb84a8b6 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ GMF_EXAMPLES_JS_FILES := $(GMF_EXAMPLES_HTML_FILES:.html=.js) GMF_APPS += mobile desktop desktop_alt iframe_api mobile_alt oeedit GMF_APPS_JS_FILES = $(shell find contribs/gmf/apps/ -type f -name '*.js') $(shell find contribs/gmf/apps/ -type f -name '*.ts') -BUILD_JS_FILES = $(shell ls -1 *.js) $(shell ls -1 utils/*.js) $(shell find buildtools/ -type f -name '*.js') $(shell find cypress/ -type f -name '*.js') +BUILD_JS_FILES = $(shell ls -1 *.js) $(shell find buildtools/ -type f -name '*.js') $(shell find cypress/ -type f -name '*.js') GMF_APPS_PARTIALS_FILES = $(shell find contribs/gmf/apps/ -type f -name '*.html' -or -name '*.html.ejs') GMF_APPS_ALL_FILES = $(shell find contribs/gmf/apps/ -type f) $(NGEO_ALL_SRC_FILES) diff --git a/buildtools/extract-ngeo-dependencies b/buildtools/extract-ngeo-dependencies index 20c87d6dcbe2..e148d41fdce4 100755 --- a/buildtools/extract-ngeo-dependencies +++ b/buildtools/extract-ngeo-dependencies @@ -51,12 +51,13 @@ all_required_js = {a for a in all_required_js if not a.startswith("./")} all_required_js = {a for a in all_required_js if not a.startswith("ngeo/")} all_required_js = {a for a in all_required_js if not a.startswith("gmf/")} all_required_js = {a for a in all_required_js if not a.startswith("gmfapi/")} -all_required_js = {a for a in all_required_js if not a.startswith("goog/")} all_required_js = {a for a in all_required_js if not a.startswith("olcs/")} all_required_js = {a for a in all_required_js if not a.startswith("jsts/")} all_required_js = {a for a in all_required_js if not a.startswith("mapillary-js/")} all_required_js = { - a for a in all_required_js if a not in ("corejs-typeahead", "angular-float-thead", "moment") + a + for a in all_required_js + if a not in ("corejs-typeahead", "angular-float-thead", "moment", "mapillary-js", "jsts", "olsc") } all_required_js = {a for a in all_required_js if not a.endswith(".css")} for js in sorted(all_required_js): diff --git a/buildtools/webpack.config.dll.js b/buildtools/webpack.config.dll.js index 4e54f76024bc..411360aa52a8 100644 --- a/buildtools/webpack.config.dll.js +++ b/buildtools/webpack.config.dll.js @@ -50,17 +50,17 @@ module.exports = { $: 'jquery', }), ], + resolve: { + alias: { + 'jquery-ui/datepicker': 'jquery-ui/ui/widgets/datepicker', // For angular-ui-date + }, + }, optimization: { minimizer: [ new TerserPlugin({ parallel: true, }), ], - resolve: { - alias: { - 'jquery-ui/datepicker': 'jquery-ui/ui/widgets/datepicker', // For angular-ui-date - }, - }, sideEffects: false, }, }; diff --git a/contribs/gmf/apps/desktop_alt/sass/desktop_alt.scss b/contribs/gmf/apps/desktop_alt/sass/desktop_alt.scss index 6a2a6eff28b7..efa88cb9b8a7 100644 --- a/contribs/gmf/apps/desktop_alt/sass/desktop_alt.scss +++ b/contribs/gmf/apps/desktop_alt/sass/desktop_alt.scss @@ -23,7 +23,7 @@ @import './vars_desktop_alt.scss'; @import 'gmf/controllers/desktop.scss'; -@import '~mapillary-js/dist/mapillary.css'; +@import '~mapillary-js'; html { body { diff --git a/examples/mapillarystreetview.scss b/examples/mapillarystreetview.scss index 4cefe3d31189..ad66fc721d48 100644 --- a/examples/mapillarystreetview.scss +++ b/examples/mapillarystreetview.scss @@ -1,5 +1,5 @@ @import './common_styles.scss'; -@import 'mapillary-js/dist/mapillary.css'; +@import 'mapillary-js'; ngeo-streetview { display: block; diff --git a/src/objectediting/component.js b/src/objectediting/component.js index 0eb2ca614e86..f188b7cd0cc4 100644 --- a/src/objectediting/component.js +++ b/src/objectediting/component.js @@ -67,8 +67,8 @@ import olStyleStyle from 'ol/style/Style'; import {CollectionEvent} from 'ol/Collection'; // @ts-ignore: not supported import -import {OL3Parser} from 'jsts/io'; -import 'jsts/monkey'; +import {OL3Parser} from 'jsts/org/locationtech/jts/io'; +import 'jsts/org/locationtech/jts/monkey'; import htmlTemplate from './component.html'; /** diff --git a/tsconfig.json b/tsconfig.json index abf376d3cd68..e154fa02378c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -24,7 +24,8 @@ "gmf/*": ["src/*"], "gmfapi/*": ["srcapi/*"], "api/*": ["api/src/*"], - "lib/*": ["lib/*"] + "lib/*": ["lib/*"], + "mapillary-js/*": ["node_modules/mapillary-js/dist/mapillary.d.ts"] } }, "include": ["src/**/*.js", "src/**/*.ts", "srcapi/**/*.ts", "lib/**/*.js", "api/src/**/*.js"],