2019-09-13 19:28:44 +03:00
|
|
|
const path = require('path')
|
|
|
|
const { VueLoaderPlugin } = require('vue-loader')
|
|
|
|
const StyleLintPlugin = require('stylelint-webpack-plugin')
|
2020-07-29 17:35:09 +03:00
|
|
|
const babelLoaderExcludeNodeModulesExcept = require('babel-loader-exclude-node-modules-except')
|
2019-09-13 19:28:44 +03:00
|
|
|
|
|
|
|
module.exports = {
|
2019-10-18 12:33:38 +03:00
|
|
|
entry: {
|
2020-03-26 14:04:34 +03:00
|
|
|
'admin-settings': path.join(__dirname, 'src', 'mainAdminSettings.js'),
|
2019-10-18 13:58:56 +03:00
|
|
|
'collections': path.join(__dirname, 'src', 'collections.js'),
|
2019-12-11 19:32:40 +03:00
|
|
|
'talk': path.join(__dirname, 'src', 'main.js'),
|
2020-10-20 18:22:46 +03:00
|
|
|
'talk-files-sidebar': [
|
|
|
|
path.join(__dirname, 'src', 'mainFilesSidebar.js'),
|
|
|
|
path.join(__dirname, 'src', 'mainFilesSidebarLoader.js'),
|
|
|
|
],
|
2020-01-13 20:36:26 +03:00
|
|
|
'talk-public-share-auth-sidebar': path.join(__dirname, 'src', 'mainPublicShareAuthSidebar.js'),
|
2020-01-15 06:21:03 +03:00
|
|
|
'talk-public-share-sidebar': path.join(__dirname, 'src', 'mainPublicShareSidebar.js'),
|
2020-03-27 18:16:23 +03:00
|
|
|
'flow': path.join(__dirname, 'src', 'flow.js'),
|
2020-07-09 18:09:47 +03:00
|
|
|
'dashboard': path.join(__dirname, 'src', 'dashboard.js'),
|
2021-02-09 19:06:58 +03:00
|
|
|
'deck': path.join(__dirname, 'src', 'deck.js'),
|
2019-10-18 12:33:38 +03:00
|
|
|
},
|
2019-09-13 19:28:44 +03:00
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, './js'),
|
|
|
|
publicPath: '/js/',
|
2020-03-27 18:16:23 +03:00
|
|
|
filename: '[name].js',
|
2019-09-13 19:28:44 +03:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.css$/,
|
2020-10-05 12:04:31 +03:00
|
|
|
use: ['style-loader', 'css-loader'],
|
2019-09-13 19:28:44 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.scss$/,
|
2020-10-05 12:04:31 +03:00
|
|
|
use: ['style-loader', 'css-loader', 'sass-loader'],
|
2019-09-13 19:28:44 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(js|vue)$/,
|
|
|
|
use: 'eslint-loader',
|
|
|
|
exclude: /node_modules/,
|
2020-03-27 18:16:23 +03:00
|
|
|
enforce: 'pre',
|
2019-09-13 19:28:44 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.vue$/,
|
|
|
|
loader: 'vue-loader',
|
2020-07-29 17:35:09 +03:00
|
|
|
exclude: babelLoaderExcludeNodeModulesExcept([
|
|
|
|
'vue-material-design-icons',
|
|
|
|
]),
|
2019-09-13 19:28:44 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
loader: 'babel-loader',
|
2020-07-29 17:35:09 +03:00
|
|
|
exclude: babelLoaderExcludeNodeModulesExcept([
|
|
|
|
'@juliushaertl/vue-richtext',
|
2021-02-12 19:17:57 +03:00
|
|
|
'@nextcloud/event-bus',
|
|
|
|
'@nextcloud/vue',
|
|
|
|
'@nextcloud/vue-dashboard',
|
|
|
|
'ansi-regex',
|
|
|
|
'char-regex',
|
2021-02-12 19:05:00 +03:00
|
|
|
'color.js',
|
2020-07-29 17:35:09 +03:00
|
|
|
'fast-xml-parser',
|
|
|
|
'hot-patcher',
|
|
|
|
'nextcloud-vue-collections',
|
2020-07-31 12:22:52 +03:00
|
|
|
'semver',
|
2020-12-22 11:45:41 +03:00
|
|
|
'string-length',
|
|
|
|
'strip-ansi',
|
|
|
|
'tributejs',
|
|
|
|
'vue-resize',
|
2021-02-12 19:17:57 +03:00
|
|
|
'webdav',
|
2020-07-29 17:35:09 +03:00
|
|
|
]),
|
2021-01-15 14:30:11 +03:00
|
|
|
options: {
|
|
|
|
plugins: ['add-module-exports'],
|
|
|
|
presets: [
|
|
|
|
/**
|
|
|
|
* From "add-module-exports" documentation:
|
|
|
|
* "webpack doesn't perform commonjs transformation for
|
|
|
|
* codesplitting. Need to set commonjs conversion."
|
|
|
|
*/
|
|
|
|
['@babel/env', { modules: 'commonjs' }],
|
|
|
|
],
|
|
|
|
},
|
2019-10-18 12:33:38 +03:00
|
|
|
},
|
2019-12-12 10:21:56 +03:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* webrtc-adapter main module does no longer provide
|
|
|
|
* "module.exports", which is expected by some elements using it
|
|
|
|
* (like "attachmediastream"), so it needs to be added back with
|
|
|
|
* a plugin.
|
|
|
|
*/
|
|
|
|
test: /node_modules\/webrtc-adapter\/.*\.js$/,
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
plugins: ['add-module-exports'],
|
|
|
|
presets: [
|
|
|
|
/**
|
|
|
|
* From "add-module-exports" documentation:
|
|
|
|
* "webpack doesn't perform commonjs transformation for
|
|
|
|
* codesplitting. Need to set commonjs conversion."
|
|
|
|
*/
|
2020-03-27 18:16:23 +03:00
|
|
|
['@babel/env', { modules: 'commonjs' }],
|
|
|
|
],
|
|
|
|
},
|
2019-12-12 10:21:56 +03:00
|
|
|
},
|
2019-10-18 12:33:38 +03:00
|
|
|
{
|
|
|
|
test: /\.(png|jpg|gif|svg)$/,
|
2020-10-05 12:04:31 +03:00
|
|
|
loader: 'url-loader',
|
2020-03-27 18:16:23 +03:00
|
|
|
},
|
|
|
|
],
|
2019-09-13 19:28:44 +03:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new VueLoaderPlugin(),
|
2020-04-21 13:17:07 +03:00
|
|
|
new StyleLintPlugin({
|
|
|
|
files: ['**/*.vue'],
|
|
|
|
}),
|
2019-09-13 19:28:44 +03:00
|
|
|
],
|
|
|
|
resolve: {
|
2020-03-27 18:16:23 +03:00
|
|
|
extensions: ['*', '.js', '.vue'],
|
2020-04-03 20:58:36 +03:00
|
|
|
symlinks: false,
|
2020-03-27 18:16:23 +03:00
|
|
|
},
|
2019-09-13 19:28:44 +03:00
|
|
|
}
|