aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-02-20 18:40:02 +0100
committerJulius Härtl <jus@bitgrid.net>2019-03-01 20:56:19 +0100
commitcab704f0cc98c6e2f6658cdb57fbabda9f448654 (patch)
treec7f845b3236d3174bfd1e3aba3ec12d318efdb17
parentfd434da9590ea28f2feec0db02b37082eabfb876 (diff)
downloadnextcloud-server-cab704f0cc98c6e2f6658cdb57fbabda9f448654.tar.gz
nextcloud-server-cab704f0cc98c6e2f6658cdb57fbabda9f448654.zip
Merge webpack into main one
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--apps/files_sharing/appinfo/app.php2
-rw-r--r--apps/files_sharing/src/additionalScripts.js23
-rw-r--r--apps/files_sharing/src/files_sharing.js26
-rw-r--r--apps/files_sharing/src/sharetabview.js2
-rw-r--r--apps/files_sharing/webpack.common.js47
-rw-r--r--apps/files_sharing/webpack.dev.js12
-rw-r--r--apps/files_sharing/webpack.js31
-rw-r--r--apps/files_sharing/webpack.prod.js7
8 files changed, 50 insertions, 100 deletions
diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php
index 3db4faf5f50..b50cc99dca7 100644
--- a/apps/files_sharing/appinfo/app.php
+++ b/apps/files_sharing/appinfo/app.php
@@ -42,7 +42,7 @@ $eventDispatcher = \OC::$server->getEventDispatcher();
$eventDispatcher->addListener(
'OCA\Files::loadAdditionalScripts',
function() {
- \OCP\Util::addScript('files_sharing', 'additionalScripts');
+ \OCP\Util::addScript('files_sharing', 'dist/additionalScripts');
}
);
diff --git a/apps/files_sharing/src/additionalScripts.js b/apps/files_sharing/src/additionalScripts.js
index dc07e2e9332..081519cc648 100644
--- a/apps/files_sharing/src/additionalScripts.js
+++ b/apps/files_sharing/src/additionalScripts.js
@@ -1,6 +1,29 @@
+__webpack_public_path__ = OC.linkTo('files_sharing', 'js/');
+__webpack_nonce__ = btoa(OC.requestToken);
+
import './share'
import './sharetabview'
import './sharebreadcrumbview'
import './style/sharetabview.scss'
import './style/sharebreadcrumb.scss'
+
+window.OCP.Collaboration.registerType('files', {
+ action: () => {
+ return new Promise((resolve, reject) => {
+ OC.dialogs.filepicker('Link to a file', function (f) {
+ const client = OC.Files.getClient();
+ client.getFileInfo(f).then((status, fileInfo) => {
+ resolve(fileInfo.id);
+ }, () => {
+ reject();
+ });
+ }, false);
+ });
+ },
+ /** used in "Link to a {typeString}" */
+ typeString: t('files_sharing', 'file'),
+ typeIconClass: 'icon-files-dark'
+});
+
+window.OCA.Sharing = OCA.Sharing;
diff --git a/apps/files_sharing/src/files_sharing.js b/apps/files_sharing/src/files_sharing.js
index 54bf71d8a19..631dc3a832a 100644
--- a/apps/files_sharing/src/files_sharing.js
+++ b/apps/files_sharing/src/files_sharing.js
@@ -1,29 +1,5 @@
-
__webpack_nonce__ = btoa(OC.requestToken);
-__webpack_public_path__ = OC.linkTo('files_sharing', 'js/dist/');
+__webpack_public_path__ = OC.linkTo('files_sharing', 'js/');
import '../js/app';
import '../js/sharedfilelist';
-import '../js/sharetabview';
-import '../js/share';
-import '../js/sharebreadcrumbview';
-
-window.OCP.Collaboration.registerType('files', {
- action: () => {
- return new Promise((resolve, reject) => {
- OC.dialogs.filepicker('Link to a file', function (f) {
- const client = OC.Files.getClient();
- client.getFileInfo(f).then((status, fileInfo) => {
- resolve(fileInfo.id);
- }, () => {
- reject();
- });
- }, false);
- });
- },
- /** used in "Link to a {typeString}" */
- typeString: t('files_sharing', 'file'),
- typeIconClass: 'icon-files-dark'
-});
-
-window.OCA.Sharing = OCA.Sharing;
diff --git a/apps/files_sharing/src/sharetabview.js b/apps/files_sharing/src/sharetabview.js
index eaed674775a..275a79198cc 100644
--- a/apps/files_sharing/src/sharetabview.js
+++ b/apps/files_sharing/src/sharetabview.js
@@ -83,7 +83,7 @@
self.trigger('sharesChanged', shareModel);
});
- import('./../src/collaborationresources').then((Resources) => {
+ import('./collaborationresources').then((Resources) => {
var vm = new Resources.Vue({
el: '#collaborationResources',
render: h => h(Resources.View),
diff --git a/apps/files_sharing/webpack.common.js b/apps/files_sharing/webpack.common.js
deleted file mode 100644
index 9479459286f..00000000000
--- a/apps/files_sharing/webpack.common.js
+++ /dev/null
@@ -1,47 +0,0 @@
-const path = require('path');
-const { VueLoaderPlugin } = require('vue-loader');
-
-module.exports = {
- entry: path.join(__dirname, 'src', 'files_sharing.js'),
- output: {
- path: path.resolve(__dirname, 'js/dist'),
- publicPath: '/js/dist/',
- filename: 'files_sharing.js',
- chunkFilename: 'files_sharing.[name].js'
-},
- module: {
- rules: [
- {
- test: /\.css$/,
- use: ['vue-style-loader', 'css-loader']
- },
- {
- test: /\.scss$/,
- use: ['vue-style-loader', 'css-loader', 'sass-loader']
- },
- {
- test: /\.vue$/,
- loader: 'vue-loader'
- },
- {
- test: /\.js$/,
- loader: 'babel-loader',
- exclude: /node_modules/
- },
- {
- test: /\.(png|jpg|gif|svg)$/,
- loader: 'file-loader',
- options: {
- name: '[name].[ext]?[hash]'
- }
- }
- ]
- },
- plugins: [new VueLoaderPlugin()],
- resolve: {
- alias: {
- vue$: 'vue/dist/vue.runtime.esm.js',
- },
- extensions: ['*', '.js', '.vue', '.json']
- }
-};
diff --git a/apps/files_sharing/webpack.dev.js b/apps/files_sharing/webpack.dev.js
deleted file mode 100644
index 0c569e7f61e..00000000000
--- a/apps/files_sharing/webpack.dev.js
+++ /dev/null
@@ -1,12 +0,0 @@
-const merge = require('webpack-merge');
-const common = require('./webpack.common.js');
-
-module.exports = merge(common, {
- mode: 'development',
- devServer: {
- historyApiFallback: true,
- noInfo: true,
- overlay: true
- },
- devtool: '#source-map',
-})
diff --git a/apps/files_sharing/webpack.js b/apps/files_sharing/webpack.js
index 815f6bd745d..aedc73706dd 100644
--- a/apps/files_sharing/webpack.js
+++ b/apps/files_sharing/webpack.js
@@ -1,26 +1,39 @@
const path = require('path');
+const { VueLoaderPlugin } = require('vue-loader');
module.exports = {
- entry: path.join(__dirname, 'src', 'additionalScripts.js'),
+ entry: {
+ 'additionalScripts': path.join(__dirname, 'src', 'additionalScripts.js'),
+ 'files_sharing': path.join(__dirname, 'src', 'files_sharing.js'),
+},
output: {
- path: path.resolve(__dirname, './js'),
+ path: path.resolve(__dirname, './js/dist/'),
publicPath: '/js/',
- filename: 'additionalScripts.js'
+ filename: '[name].js',
+ chunkFilename: 'files_sharing.[id].js'
+
},
module: {
rules: [
{
test: /\.css$/,
- use: ['style-loader', 'css-loader']
+ use: ['vue-style-loader', 'css-loader']
},
{
test: /\.scss$/,
- use: ['style-loader', 'css-loader', 'sass-loader']
+ use: ['vue-style-loader', 'css-loader', 'sass-loader']
+ },
+ {
+ test: /\.vue$/,
+ loader: 'vue-loader'
},
{
test: /\.js$/,
loader: 'babel-loader',
- exclude: /node_modules/
+ exclude: /node_modules/,
+ options: {
+ plugins: ['@babel/plugin-syntax-dynamic-import']
+ }
},
{
test: /\.(png|jpg|gif|svg)$/,
@@ -31,7 +44,11 @@ module.exports = {
}
]
},
+ plugins: [new VueLoaderPlugin()],
resolve: {
- extensions: ['*', '.js']
+ alias: {
+ vue$: 'vue/dist/vue.runtime.esm.js',
+ },
+ extensions: ['*', '.js', '.vue', '.json']
}
};
diff --git a/apps/files_sharing/webpack.prod.js b/apps/files_sharing/webpack.prod.js
deleted file mode 100644
index f081567bd63..00000000000
--- a/apps/files_sharing/webpack.prod.js
+++ /dev/null
@@ -1,7 +0,0 @@
-const merge = require('webpack-merge')
-const common = require('./webpack.common.js')
-
-module.exports = merge(common, {
- mode: 'production',
- devtool: '#source-map'
-})