Merge pull request #13618 from nextcloud/enh/13608/move_bundlejs_towebpack

Move from JSCombiner to webpack: merged-share-backend
This commit is contained in:
Roeland Jago Douma 2019-01-16 12:21:04 +01:00 committed by GitHub
commit cff89c2a44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 113 additions and 66 deletions

24
core/js/dist/share_backend.js vendored Normal file

File diff suppressed because one or more lines are too long

1
core/js/dist/share_backend.js.map vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,9 @@
require('./shareconfigmodel.js')
require('./sharetemplates.js')
require('./shareitemmodel.js')
require('./sharesocialmanager.js')
require('./sharedialogresharerinfoview.js')
require('./sharedialoglinkshareview.js')
require('./sharedialogshareelistview.js')
require('./sharedialogview.js')
require('./share.js')

View File

@ -1,11 +0,0 @@
[
"shareconfigmodel.js",
"sharetemplates.js",
"shareitemmodel.js",
"sharesocialmanager.js",
"sharedialogresharerinfoview.js",
"sharedialoglinkshareview.js",
"sharedialogshareelistview.js",
"sharedialogview.js",
"share.js"
]

View File

@ -1,51 +1,71 @@
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: {
main: path.join(__dirname, 'src/main.js')
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'js/dist')
},
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /davclient/,
use: 'exports-loader?dav'
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif)$/,
loader: 'url-loader',
options: {
name: '[name].[ext]?[hash]',
limit: 8192
}
}
]
},
plugins: [
new webpack.ProvidePlugin({
'_': "underscore",
$: "jquery",
jQuery: "jquery"
})
],
resolve: {
alias: {
handlebars: 'handlebars/runtime'
module.exports = [
{
entry: {
main: path.join(__dirname, 'src/main.js'),
},
extensions: ['*', '.js'],
symlinks: false
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'js/dist')
},
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /davclient/,
use: 'exports-loader?dav'
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif)$/,
loader: 'url-loader',
options: {
name: '[name].[ext]?[hash]',
limit: 8192
}
}
]
},
plugins: [
new webpack.ProvidePlugin({
'_': "underscore",
$: "jquery",
jQuery: "jquery"
})
],
resolve: {
alias: {
handlebars: 'handlebars/runtime'
},
extensions: ['*', '.js'],
symlinks: false
}
},
{
entry: {
share_backend: path.resolve(__dirname, 'js/merged-share-backend.js')
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'js/dist')
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
}
]
}
}
};
];

View File

@ -1,7 +1,9 @@
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
module.exports = merge(common, {
mode: 'development',
devtool: 'cheap-source-map',
})
module.exports = common.map(
config => merge(config, {
mode: 'development',
devtool: 'cheap-source-map',
})
)

View File

@ -1,7 +1,9 @@
const merge = require('webpack-merge')
const common = require('./webpack.common.js')
module.exports = merge(common, {
mode: 'production',
devtool: '#source-map'
})
module.exports = common.map(
config => merge(config, {
mode: 'production',
devtool: '#source-map',
})
)

View File

@ -85,7 +85,7 @@ class Share extends Constants {
'supportedFileExtensions' => $supportedFileExtensions
);
if(count(self::$backendTypes) === 1) {
Util::addScript('core', 'merged-share-backend');
Util::addScript('core', 'dist/share_backend');
}
return true;
}