Build JS files into public/js instead of public/js/dist
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
This commit is contained in:
parent
7b23d2cae3
commit
524a39f63d
@ -1,5 +1,3 @@
|
||||
js/vendor/
|
||||
js/dist/
|
||||
public/js/
|
||||
tmp/
|
||||
vendor/
|
||||
|
||||
@ -52,7 +52,7 @@ validateExtension() {
|
||||
foundFileExt
|
||||
fi
|
||||
;;
|
||||
public/js/dist/*)
|
||||
public/js/*)
|
||||
if [ "${extension}" != "js" ] && [ "${extension}" != "map" ]; then
|
||||
foundFileExt
|
||||
fi
|
||||
|
||||
@ -694,7 +694,7 @@ A list of files and corresponding functionality which degrade gracefully when re
|
||||
* :file:`./setup/` (setup script)
|
||||
* :file:`./examples/` (configuration examples)
|
||||
* :file:`./resources/sql/` (SQL scripts to configure advanced functionalities)
|
||||
* :file:`./resources/js/src/` (Source files to re-build `./public/js/dist/`)
|
||||
* :file:`./resources/js/src/` (Source files to re-build `./public/js/`)
|
||||
* :file:`./resources/js/global.d.ts` JS type declaration file
|
||||
* Run `rm -rv vendor/tecnickcom/tcpdf && composer dump-autoload --no-interaction --optimize --dev` (exporting to PDF)
|
||||
* Run `rm -rv vendor/williamdes/mariadb-mysql-kbs && composer dump-autoload --no-interaction --optimize --dev` (external links to MariaDB and MySQL documentations)
|
||||
|
||||
2
public/js/vendor/.gitignore
vendored
2
public/js/vendor/.gitignore
vendored
@ -1,2 +0,0 @@
|
||||
/*
|
||||
!/.gitignore
|
||||
@ -255,7 +255,7 @@ function loadJSAndGISEditor (resolve) {
|
||||
let script;
|
||||
|
||||
script = document.createElement('script');
|
||||
script.src = 'js/dist/table/gis_visualization.js';
|
||||
script.src = 'js/table/gis_visualization.js';
|
||||
document.head.appendChild(script);
|
||||
|
||||
// OpenLayers.js is BIG and takes time. So asynchronous loading would not work.
|
||||
|
||||
@ -785,8 +785,7 @@ const AJAX = {
|
||||
var script = document.createElement('script');
|
||||
var self = this;
|
||||
|
||||
var file = name.indexOf('vendor/') !== -1 ? name : 'dist/' + name;
|
||||
script.src = 'js/' + file + '?' + 'v=' + encodeURIComponent(CommonParams.get('version'));
|
||||
script.src = 'js/' + name + '?' + 'v=' + encodeURIComponent(CommonParams.get('version'));
|
||||
script.async = false;
|
||||
script.onload = function () {
|
||||
self.done(name, callback);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{% for file in files %}
|
||||
<script data-cfasync="false" src="{{ base_dir }}{{ not (file.filename starts with 'index.php') ? 'js/' -}}
|
||||
{{- file.filename starts with 'vendor/' or file.filename starts with 'index.php' ? file.filename : 'dist/' ~ file.filename -}}
|
||||
<script data-cfasync="false" src="{{ base_dir }}
|
||||
{{- file.filename starts with 'index.php' ? file.filename : 'js/' ~ file.filename -}}
|
||||
{{- '.php' in file.filename ? get_common(file.params|merge({'v': pma.version})) : '?v=' ~ pma.version|url_encode }}"></script>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
<script src="../js/vendor/jquery/jquery-ui.min.js"></script>
|
||||
<script src="../js/vendor/bootstrap/bootstrap.bundle.min.js"></script>
|
||||
<script src="../{{ url('/messages') }}"></script>
|
||||
<script src="../js/dist/shared.js"></script>
|
||||
<script src="../js/dist/setup/scripts.js"></script>
|
||||
<script src="../js/shared.js"></script>
|
||||
<script src="../js/setup/scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ class ScriptsTest extends AbstractTestCase
|
||||
$actual = $this->object->getDisplay();
|
||||
|
||||
self::assertStringContainsString(
|
||||
'src="js/dist/common.js?v=' . rawurlencode(Version::VERSION) . '"',
|
||||
'src="js/common.js?v=' . rawurlencode(Version::VERSION) . '"',
|
||||
$actual,
|
||||
);
|
||||
self::assertStringContainsString(
|
||||
|
||||
@ -79,14 +79,21 @@ module.exports = [
|
||||
},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
path: publicPath + '/js/dist',
|
||||
path: publicPath + '/js',
|
||||
},
|
||||
optimization: {
|
||||
chunkIds: 'named',
|
||||
moduleIds: 'named',
|
||||
runtimeChunk: 'single',
|
||||
splitChunks: {
|
||||
chunks: 'all',
|
||||
name: 'shared',
|
||||
minSize: 1,
|
||||
cacheGroups: {
|
||||
shared: {
|
||||
name: 'shared',
|
||||
chunks: 'all',
|
||||
minChunks: 2,
|
||||
minSize: 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
externals: {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user