diff --git a/CHANGES.rst b/CHANGES.rst index cda72d1a..647c30dd 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,9 @@ Changes for CrateDB Admin Interface Unreleased ========== +- Worked around an issue with Webpack and Angular 1.8.x that caused the + Admin UI to not load correctly. + 2024-10-28 1.24.8 ================= diff --git a/DEVELOP.rst b/DEVELOP.rst index 17e7ddce..4e614b36 100644 --- a/DEVELOP.rst +++ b/DEVELOP.rst @@ -41,6 +41,19 @@ After the application has been compiled and the Webpack development server has started, the process should automatically open a browser tab. +Working with production builds locally +====================================== + +You need to build for production:: + + npm run build + +Then, you can start a local server to serve the production build:: + + npm run serve + +This will start a server on ``http://localhost:8000/``. + Description =========== diff --git a/app/app.module.js b/app/app.module.js index 92b7fca2..2b026642 100644 --- a/app/app.module.js +++ b/app/app.module.js @@ -149,9 +149,9 @@ $.get('static/conf/plugins.json', function (plugins) { } ]); - appModule.config(function($sceDelegateProvider) { + appModule.config(['$sceDelegateProvider', function($sceDelegateProvider) { $sceDelegateProvider.resourceUrlWhitelist(['**']); - }); + }]); // Configuration of i18n Internationalization appModule.config(['$translateProvider', '$translatePartialLoaderProvider', function ($translateProvider, $translatePartialLoaderProvider) { diff --git a/package.json b/package.json index c23508f2..fe667458 100644 --- a/package.json +++ b/package.json @@ -76,6 +76,7 @@ "cratedb": "docker run -it --rm --publish 4200:4200 crate/crate:nightly -Chttp.cors.enabled=true -Chttp.cors.allow-origin=*", "develop": "webpack serve --progress --config=webpack.dev.config.js --open-target=http://localhost:9000/?base_uri=http://localhost:4200#!/", "build": "webpack --config webpack.prod.config.js --progress", + "serve": "cd build && python3 -m http.server", "test": "karma start" } } diff --git a/webpack.prod.config.js b/webpack.prod.config.js index e33b8af8..c3c4e446 100644 --- a/webpack.prod.config.js +++ b/webpack.prod.config.js @@ -18,8 +18,9 @@ module.exports = { filename: 'static/libs/[name].bundle.js', path: path.resolve(__dirname, 'build') }, - optimization: { - runtimeChunk: 'single' + optimization: { + runtimeChunk: 'single', + minimize: false, }, plugins: [ new CleanWebpackPlugin(),