mirror of
https://github.com/ansible/awx.git
synced 2026-05-16 05:47:38 -02:30
Implement manual initialzation for Angular app
Manual initialization allows for some asynchronous work to finish ahead of Angular's startup. The initial motivation is to be able to guarantee translation files have been fetched before rendering content that needs translation. If a locale isn't supported or if the request to get a json file fails, the i18n service falls back to en. Signed-off-by: gconsidine <gconsidi@redhat.com>
This commit is contained in:
@@ -109,7 +109,7 @@ const base = {
|
||||
jsonlint: 'codemirror.jsonlint'
|
||||
}),
|
||||
new ExtractTextPlugin('css/[name].[chunkhash].css'),
|
||||
new CleanWebpackPlugin([STATIC_PATH, COVERAGE_PATH, LANGUAGES_PATH], {
|
||||
new CleanWebpackPlugin([STATIC_PATH, COVERAGE_PATH], {
|
||||
root: UI_PATH,
|
||||
verbose: false
|
||||
}),
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
const path = require('path');
|
||||
|
||||
const _ = require('lodash');
|
||||
|
||||
const base = require('./webpack.base');
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
const path = require('path');
|
||||
|
||||
const _ = require('lodash');
|
||||
const webpack = require('webpack');
|
||||
|
||||
const STATIC_URL = '/static/';
|
||||
|
||||
const development = require('./webpack.development');
|
||||
const development = require('./webpack.base');
|
||||
|
||||
const test = {
|
||||
devtool: 'cheap-source-map',
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
$basePath: STATIC_URL
|
||||
|
||||
@@ -2,8 +2,8 @@ const path = require('path');
|
||||
|
||||
const _ = require('lodash');
|
||||
const webpack = require('webpack');
|
||||
const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin');
|
||||
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
|
||||
const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin');
|
||||
|
||||
const TARGET_PORT = _.get(process.env, 'npm_package_config_django_port', 8043);
|
||||
const TARGET_HOST = _.get(process.env, 'npm_package_config_django_host', 'https://localhost');
|
||||
@@ -29,6 +29,7 @@ const watch = {
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new HtmlWebpackHarddiskPlugin(),
|
||||
new HardSourceWebpackPlugin({
|
||||
cacheDirectory: 'node_modules/.cache/hard-source/[confighash]',
|
||||
recordsPath: 'node_modules/.cache/hard-source/[confighash]/records.json',
|
||||
@@ -41,7 +42,6 @@ const watch = {
|
||||
files: ['package.json']
|
||||
}
|
||||
}),
|
||||
new HtmlWebpackHarddiskPlugin(),
|
||||
new webpack.HotModuleReplacementPlugin()
|
||||
],
|
||||
devServer: {
|
||||
|
||||
Reference in New Issue
Block a user