2019-09-25 10:55:33 +03:00
|
|
|
/* eslint-disable camelcase */
|
2020-07-18 04:16:07 +03:00
|
|
|
const { merge } = require('webpack-merge')
|
2019-09-25 10:55:33 +03:00
|
|
|
const { VueLoaderPlugin } = require('vue-loader')
|
2020-07-31 14:16:57 +03:00
|
|
|
const BabelLoaderExcludeNodeModulesExcept = require('babel-loader-exclude-node-modules-except')
|
2020-07-31 10:40:53 +03:00
|
|
|
const path = require('path')
|
2019-02-20 11:06:56 +03:00
|
|
|
|
2019-09-25 10:55:33 +03:00
|
|
|
const accessibility = require('./apps/accessibility/webpack')
|
|
|
|
const comments = require('./apps/comments/webpack')
|
2019-05-23 18:03:04 +03:00
|
|
|
const core = require('./core/webpack')
|
2020-06-08 16:39:26 +03:00
|
|
|
const dashboard = require('./apps/dashboard/webpack')
|
2019-05-23 18:03:04 +03:00
|
|
|
const files = require('./apps/files/webpack')
|
2019-09-25 10:55:33 +03:00
|
|
|
const files_sharing = require('./apps/files_sharing/webpack')
|
|
|
|
const files_trashbin = require('./apps/files_trashbin/webpack')
|
|
|
|
const files_versions = require('./apps/files_versions/webpack')
|
|
|
|
const oauth2 = require('./apps/oauth2/webpack')
|
|
|
|
const settings = require('./apps/settings/webpack')
|
|
|
|
const systemtags = require('./apps/systemtags/webpack')
|
2020-06-02 13:48:37 +03:00
|
|
|
const user_status = require('./apps/user_status/webpack')
|
2020-08-06 11:43:26 +03:00
|
|
|
const weather_status = require('./apps/weather_status/webpack')
|
2019-09-25 10:55:33 +03:00
|
|
|
const twofactor_backupscodes = require('./apps/twofactor_backupcodes/webpack')
|
2020-04-16 19:00:23 +03:00
|
|
|
const updatenotification = require('./apps/updatenotification/webpack')
|
2019-09-25 10:55:33 +03:00
|
|
|
const workflowengine = require('./apps/workflowengine/webpack')
|
2019-05-24 15:08:39 +03:00
|
|
|
|
2019-10-16 10:05:16 +03:00
|
|
|
const modules = {
|
|
|
|
accessibility,
|
|
|
|
comments,
|
2019-05-23 18:03:04 +03:00
|
|
|
core,
|
2020-06-08 16:39:26 +03:00
|
|
|
dashboard,
|
2019-05-23 18:03:04 +03:00
|
|
|
files,
|
2019-10-16 10:05:16 +03:00
|
|
|
files_sharing,
|
|
|
|
files_trashbin,
|
|
|
|
files_versions,
|
|
|
|
oauth2,
|
2019-05-23 18:03:04 +03:00
|
|
|
settings,
|
2019-10-16 10:05:16 +03:00
|
|
|
systemtags,
|
2020-06-02 13:48:37 +03:00
|
|
|
user_status,
|
2020-08-06 11:43:26 +03:00
|
|
|
weather_status,
|
2019-10-16 10:05:16 +03:00
|
|
|
twofactor_backupscodes,
|
2020-04-16 19:00:23 +03:00
|
|
|
updatenotification,
|
2021-03-17 10:25:31 +03:00
|
|
|
workflowengine,
|
2019-10-16 10:05:16 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
const modulesToBuild = () => {
|
|
|
|
const MODULE = process.env.MODULE
|
|
|
|
if (MODULE) {
|
|
|
|
if (!modules[MODULE]) {
|
|
|
|
throw new Error(`No module "${MODULE}" found`)
|
|
|
|
}
|
2021-03-17 10:25:31 +03:00
|
|
|
return [modules[MODULE]]
|
2019-10-16 10:05:16 +03:00
|
|
|
}
|
|
|
|
return Object.values(modules)
|
|
|
|
}
|
|
|
|
|
2019-05-24 15:08:39 +03:00
|
|
|
module.exports = []
|
|
|
|
.concat(
|
2019-10-16 10:05:16 +03:00
|
|
|
...modulesToBuild()
|
2019-05-24 15:08:39 +03:00
|
|
|
)
|
2020-07-20 18:07:45 +03:00
|
|
|
.map(config => merge({
|
2019-09-25 10:55:33 +03:00
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.css$/,
|
2020-11-06 10:06:21 +03:00
|
|
|
use: ['style-loader', 'css-loader'],
|
2019-09-25 10:55:33 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.scss$/,
|
2020-11-06 10:06:21 +03:00
|
|
|
use: ['style-loader', 'css-loader', 'sass-loader'],
|
2019-09-25 10:55:33 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(js|vue)$/,
|
|
|
|
loader: 'eslint-loader',
|
|
|
|
// no checks against vendors, modules or handlebar compiled files
|
|
|
|
exclude: /node_modules|vendor|templates\.js/,
|
|
|
|
enforce: 'pre',
|
2019-05-24 15:08:39 +03:00
|
|
|
},
|
2019-09-25 10:55:33 +03:00
|
|
|
{
|
|
|
|
test: /\.vue$/,
|
|
|
|
loader: 'vue-loader',
|
2020-08-04 11:00:27 +03:00
|
|
|
exclude: BabelLoaderExcludeNodeModulesExcept([
|
|
|
|
'vue-material-design-icons',
|
|
|
|
]),
|
2019-09-25 10:55:33 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
loader: 'babel-loader',
|
2019-05-23 18:03:04 +03:00
|
|
|
// automatically detect necessary packages to
|
|
|
|
// transpile in the node_modules folder
|
2020-07-31 14:16:57 +03:00
|
|
|
exclude: BabelLoaderExcludeNodeModulesExcept([
|
|
|
|
'@nextcloud/dialogs',
|
|
|
|
'@nextcloud/event-bus',
|
2021-01-15 16:26:50 +03:00
|
|
|
'@nextcloud/vue-dashboard',
|
2020-07-31 14:16:57 +03:00
|
|
|
'davclient.js',
|
2020-07-31 10:40:53 +03:00
|
|
|
'nextcloud-vue-collections',
|
|
|
|
'p-finally',
|
|
|
|
'p-limit',
|
|
|
|
'p-locate',
|
|
|
|
'p-queue',
|
|
|
|
'p-timeout',
|
|
|
|
'p-try',
|
2020-07-31 14:16:57 +03:00
|
|
|
'semver',
|
2020-10-20 15:24:01 +03:00
|
|
|
'striptags',
|
2020-07-31 10:40:53 +03:00
|
|
|
'toastify-js',
|
|
|
|
'v-tooltip',
|
|
|
|
]),
|
2019-09-25 10:55:33 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(png|jpg|gif)$/,
|
|
|
|
loader: 'url-loader',
|
|
|
|
options: {
|
|
|
|
name: '[name].[ext]?[hash]',
|
2020-07-20 18:07:45 +03:00
|
|
|
limit: 8192,
|
|
|
|
},
|
2019-09-25 10:55:33 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.handlebars/,
|
|
|
|
loader: 'handlebars-loader',
|
|
|
|
query: {
|
2020-07-20 18:07:45 +03:00
|
|
|
extensions: '.handlebars',
|
|
|
|
},
|
|
|
|
},
|
2019-09-25 10:55:33 +03:00
|
|
|
|
2020-07-20 18:07:45 +03:00
|
|
|
],
|
2019-09-25 10:55:33 +03:00
|
|
|
},
|
|
|
|
plugins: [new VueLoaderPlugin()],
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
OC: path.resolve(__dirname, './core/src/OC'),
|
|
|
|
OCA: path.resolve(__dirname, './core/src/OCA'),
|
|
|
|
// make sure to use the handlebar runtime when importing
|
2020-07-20 18:07:45 +03:00
|
|
|
handlebars: 'handlebars/runtime',
|
2019-09-25 10:55:33 +03:00
|
|
|
},
|
2019-10-07 17:28:10 +03:00
|
|
|
extensions: ['*', '.js', '.vue'],
|
2020-07-20 18:07:45 +03:00
|
|
|
symlinks: false,
|
|
|
|
},
|
2019-09-25 10:55:33 +03:00
|
|
|
}, config))
|