Merge pull request #13618 from nextcloud/enh/13608/move_bundlejs_towebpack
Move from JSCombiner to webpack: merged-share-backend
This commit is contained in:
commit
cff89c2a44
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -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')
|
|
@ -1,11 +0,0 @@
|
|||
[
|
||||
"shareconfigmodel.js",
|
||||
"sharetemplates.js",
|
||||
"shareitemmodel.js",
|
||||
"sharesocialmanager.js",
|
||||
"sharedialogresharerinfoview.js",
|
||||
"sharedialoglinkshareview.js",
|
||||
"sharedialogshareelistview.js",
|
||||
"sharedialogview.js",
|
||||
"share.js"
|
||||
]
|
|
@ -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/
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
];
|
||||
|
|
|
@ -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',
|
||||
})
|
||||
)
|
||||
|
|
|
@ -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',
|
||||
})
|
||||
)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue