Move of files_versions to webpack

* Move CSS into bundle
* Old merged.json no longer needed!
* No need to load the style still

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2019-02-03 19:56:44 +01:00
parent 53e8957a55
commit 7f88654147
No known key found for this signature in database
GPG Key ID: F941078878347C0C
20 changed files with 61 additions and 27 deletions

2
.gitattributes vendored
View File

@ -3,6 +3,8 @@
/apps/accessibility/js/accessibility.js binary /apps/accessibility/js/accessibility.js binary
/apps/accessibility/js/accessibility.js.map binary /apps/accessibility/js/accessibility.js.map binary
/apps/files_versions/js/files_versions.js binary
/apps/files_versions/js/files_versions.js.map binary
/apps/oauth2/js/oauth2.js binary /apps/oauth2/js/oauth2.js binary
/apps/oauth2/js/oauth2.js.map binary /apps/oauth2/js/oauth2.js.map binary
/apps/twofactor_backupcodes/js/*.js binary /apps/twofactor_backupcodes/js/*.js binary

View File

@ -1,2 +1,3 @@
# compiled vue templates # compiled vue templates
js/templates.js js/files_versions.js
src/templates.js

View File

@ -22,6 +22,4 @@
* *
*/ */
\OCP\Util::addStyle('files_versions', 'versions');
\OCA\Files_Versions\Hooks::connectHooks(); \OCA\Files_Versions\Hooks::connectHooks();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,7 +0,0 @@
[
"versionmodel.js",
"templates.js",
"versioncollection.js",
"versionstabview.js",
"filesplugin.js"
]

View File

@ -149,6 +149,6 @@ class Hooks {
* Load additional scripts when the files app is visible * Load additional scripts when the files app is visible
*/ */
public static function onLoadFilesAppScripts() { public static function onLoadFilesAppScripts() {
\OCP\Util::addScript('files_versions', 'merged'); \OCP\Util::addScript('files_versions', 'files_versions');
} }
} }

View File

@ -0,0 +1,8 @@
import './versionmodel'
import './templates'
import './versioncollection'
import './versionstabview'
import './filesplugin'
import './css/versions.css'
window.OCA.Versions = OCA.Versions

View File

@ -0,0 +1,37 @@
const path = require('path');
module.exports = {
entry: path.join(__dirname, 'src', 'files_versions.js'),
output: {
path: path.resolve(__dirname, 'js'),
publicPath: '/js/',
filename: 'files_versions.js'
},
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
}
}
]
},
resolve: {
extensions: ['*', '.js']
}
};

View File

@ -13,9 +13,7 @@
"sharedialoglinkshareview.js", "sharedialoglinkshareview.js",
"sharedialogresharerinfoview.js", "sharedialogresharerinfoview.js",
"sharedialogshareelistview.js", "sharedialogshareelistview.js",
"contactsmenu_templates.js",
"public/publicpage.js", "public/publicpage.js",
"multiselect.js",
"oc-requesttoken.js", "oc-requesttoken.js",
"setupchecks.js", "setupchecks.js",
"../search/js/search.js", "../search/js/search.js",

View File

@ -45,6 +45,7 @@ module.exports = function(config) {
return [ return [
'files', 'files',
'files_trashbin', 'files_trashbin',
'files_versions',
{ {
name: 'files_sharing', name: 'files_sharing',
srcFiles: [ srcFiles: [
@ -74,17 +75,6 @@ module.exports = function(config) {
], ],
testFiles: ['apps/files_external/tests/js/*.js'] testFiles: ['apps/files_external/tests/js/*.js']
}, },
{
name: 'files_versions',
srcFiles: [
// need to enforce loading order...
'apps/files_versions/js/versionmodel.js',
'apps/files_versions/js/templates.js',
'apps/files_versions/js/versioncollection.js',
'apps/files_versions/js/versionstabview.js'
],
testFiles: ['apps/files_versions/tests/js/**/*.js']
},
{ {
name: 'comments', name: 'comments',
srcFiles: [ srcFiles: [
@ -117,8 +107,7 @@ module.exports = function(config) {
{ {
name: 'settings', name: 'settings',
srcFiles: [ srcFiles: [
'settings/js/apps.js', 'settings/js/apps.js'
'core/vendor/marked/marked.min.js'
] ]
} }
]; ];

View File

@ -1,5 +1,10 @@
const core = require('./core/webpack'); const core = require('./core/webpack');
const files_trashbin = require('./apps/files_trashbin/webpack') const files_trashbin = require('./apps/files_trashbin/webpack')
const files_versions = require('./apps/files_versions/webpack');
const oauth2 = require('./apps/oauth2/webpack') const oauth2 = require('./apps/oauth2/webpack')
module.exports = [].concat(core, files_trashbin, oauth2); module.exports = [].concat(
core,
files_trashbin,
files_versions,
oauth2);