mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 01:17:37 -02:30
Merge pull request #122 from gconsidine/ui/move-install-template-to-prod-build
Move install.template.ejs to be built for prod only
This commit is contained in:
@@ -25,8 +25,6 @@ const APP_ENTRY = path.join(SOURCE_PATH, 'app.js');
|
|||||||
const VENDOR_ENTRY = path.join(SOURCE_PATH, 'vendor.js');
|
const VENDOR_ENTRY = path.join(SOURCE_PATH, 'vendor.js');
|
||||||
const INDEX_ENTRY = path.join(CLIENT_PATH, 'index.template.ejs');
|
const INDEX_ENTRY = path.join(CLIENT_PATH, 'index.template.ejs');
|
||||||
const INDEX_OUTPUT = path.join(UI_PATH, 'templates/ui/index.html');
|
const INDEX_OUTPUT = path.join(UI_PATH, 'templates/ui/index.html');
|
||||||
const INSTALL_RUNNING_ENTRY = path.join(CLIENT_PATH, 'installing.template.ejs')
|
|
||||||
const INSTALL_RUNNING_OUTPUT = path.join(UI_PATH, 'templates/ui/installing.html');
|
|
||||||
const THEME_ENTRY = path.join(LIB_PATH, 'theme', 'index.less');
|
const THEME_ENTRY = path.join(LIB_PATH, 'theme', 'index.less');
|
||||||
const OUTPUT = 'js/[name].[hash].js';
|
const OUTPUT = 'js/[name].[hash].js';
|
||||||
const CHUNKS = ['vendor', 'app'];
|
const CHUNKS = ['vendor', 'app'];
|
||||||
@@ -170,19 +168,6 @@ let base = {
|
|||||||
moduleA.files.sort((fileA, fileB) => fileA.includes('js') ? -1 : 1)
|
moduleA.files.sort((fileA, fileB) => fileA.includes('js') ? -1 : 1)
|
||||||
moduleB.files.sort((fileA, fileB) => fileA.includes('js') ? -1 : 1)
|
moduleB.files.sort((fileA, fileB) => fileA.includes('js') ? -1 : 1)
|
||||||
|
|
||||||
return moduleA.names[0] === 'vendor' ? -1 : 1
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
new HtmlWebpackPlugin({
|
|
||||||
alwaysWriteToDisk: true,
|
|
||||||
template: INSTALL_RUNNING_ENTRY,
|
|
||||||
filename: INSTALL_RUNNING_OUTPUT,
|
|
||||||
inject: false,
|
|
||||||
chunks: CHUNKS,
|
|
||||||
chunksSortMode: (moduleA, moduleB) => {
|
|
||||||
moduleA.files.sort((fileA, fileB) => fileA.includes('js') ? -1 : 1)
|
|
||||||
moduleB.files.sort((fileA, fileB) => fileA.includes('js') ? -1 : 1)
|
|
||||||
|
|
||||||
return moduleA.names[0] === 'vendor' ? -1 : 1
|
return moduleA.names[0] === 'vendor' ? -1 : 1
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,15 +1,36 @@
|
|||||||
const _ = require('lodash');
|
const path = require('path');
|
||||||
|
|
||||||
|
const _ = require('lodash');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
|
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
|
||||||
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
|
|
||||||
let base = require('./webpack.base');
|
let base = require('./webpack.base');
|
||||||
|
|
||||||
|
const CLIENT_PATH = path.resolve(__dirname, '../client');
|
||||||
|
const UI_PATH = path.resolve(__dirname, '..');
|
||||||
|
const INSTALL_RUNNING_ENTRY = path.join(CLIENT_PATH, 'installing.template.ejs')
|
||||||
|
const INSTALL_RUNNING_OUTPUT = path.join(UI_PATH, 'templates/ui/installing.html');
|
||||||
|
const CHUNKS = ['vendor', 'app'];
|
||||||
|
|
||||||
let production = {
|
let production = {
|
||||||
plugins: [
|
plugins: [
|
||||||
new UglifyJSPlugin({
|
new UglifyJSPlugin({
|
||||||
compress: true,
|
compress: true,
|
||||||
mangle: false
|
mangle: false
|
||||||
|
}),
|
||||||
|
new HtmlWebpackPlugin({
|
||||||
|
alwaysWriteToDisk: true,
|
||||||
|
template: INSTALL_RUNNING_ENTRY,
|
||||||
|
filename: INSTALL_RUNNING_OUTPUT,
|
||||||
|
inject: false,
|
||||||
|
chunks: CHUNKS,
|
||||||
|
chunksSortMode: (moduleA, moduleB) => {
|
||||||
|
moduleA.files.sort((fileA, fileB) => fileA.includes('js') ? -1 : 1);
|
||||||
|
moduleB.files.sort((fileA, fileB) => fileA.includes('js') ? -1 : 1);
|
||||||
|
|
||||||
|
return moduleA.names[0] === 'vendor' ? -1 : 1;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user