Move files_sharing additionalscripts over to webpack

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2019-02-15 09:10:07 +01:00
parent 49a0ea01e5
commit 0a4569dff7
No known key found for this signature in database
GPG key ID: F941078878347C0C
16 changed files with 75 additions and 11 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_sharing/js/additionalScripts.js binary
/apps/files_sharing/js/additionalScripts.js.map binary
/apps/files_versions/js/files_versions.js binary /apps/files_versions/js/files_versions.js binary
/apps/files_versions/js/files_versions.js.map binary /apps/files_versions/js/files_versions.js.map binary
/apps/oauth2/js/oauth2.js binary /apps/oauth2/js/oauth2.js binary

View file

@ -0,0 +1,2 @@
#webpack bundled files
js/additionalScripts.js

View file

@ -42,7 +42,6 @@ $eventDispatcher = \OC::$server->getEventDispatcher();
$eventDispatcher->addListener( $eventDispatcher->addListener(
'OCA\Files::loadAdditionalScripts', 'OCA\Files::loadAdditionalScripts',
function() { function() {
\OCP\Util::addStyle('files_sharing', 'mergedAdditionalStyles');
\OCP\Util::addScript('files_sharing', 'additionalScripts'); \OCP\Util::addScript('files_sharing', 'additionalScripts');
} }
); );

View file

@ -1,2 +0,0 @@
@import 'sharetabview.scss';
@import 'sharebreadcrumb.scss';

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,5 +0,0 @@
[
"share.js",
"sharetabview.js",
"sharebreadcrumbview.js"
]

View file

@ -0,0 +1,6 @@
import './share'
import './sharetabview'
import './sharebreadcrumbview'
import './style/sharetabview.scss'
import './style/sharebreadcrumb.scss'

View file

@ -0,0 +1,37 @@
const path = require('path');
module.exports = {
entry: path.join(__dirname, 'src', 'additionalScripts.js'),
output: {
path: path.resolve(__dirname, './js'),
publicPath: '/js/',
filename: 'additionalScripts.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

@ -54,10 +54,8 @@ module.exports = function(config) {
// up with the global namespace/classes/state // up with the global namespace/classes/state
'apps/files_sharing/js/app.js', 'apps/files_sharing/js/app.js',
'apps/files_sharing/js/sharedfilelist.js', 'apps/files_sharing/js/sharedfilelist.js',
'apps/files_sharing/js/share.js', 'apps/files_sharing/js/additionalScripts.js',
'apps/files_sharing/js/sharebreadcrumbview.js',
'apps/files_sharing/js/public.js', 'apps/files_sharing/js/public.js',
'apps/files_sharing/js/sharetabview.js',
'apps/files_sharing/js/files_drop.js', 'apps/files_sharing/js/files_drop.js',
'apps/files_sharing/js/templates.js', 'apps/files_sharing/js/templates.js',
], ],

View file

@ -1,4 +1,5 @@
const core = require('./core/webpack'); const core = require('./core/webpack');
const files_sharing = require('./apps/files_sharing/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 files_versions = require('./apps/files_versions/webpack');
const oauth2 = require('./apps/oauth2/webpack') const oauth2 = require('./apps/oauth2/webpack')
@ -6,6 +7,7 @@ const systemtags = require('./apps/systemtags/webpack')
module.exports = [].concat( module.exports = [].concat(
core, core,
files_sharing,
files_trashbin, files_trashbin,
files_versions, files_versions,
oauth2, oauth2,