-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.js
46 lines (39 loc) · 1.29 KB
/
webpack.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const path = require('path')
const webpackConfig = require('@nextcloud/webpack-vue-config')
const webpackRules = require('@nextcloud/webpack-vue-config/rules')
const BabelLoaderExcludeNodeModulesExcept = require('babel-loader-exclude-node-modules-except')
webpackConfig.entry = {
'admin-settings': path.join(__dirname, 'src', 'mainAdminSettings.js'),
'personal-settings': path.join(__dirname, 'src', 'mainPersonalSettings.js'),
dashboard: path.join(__dirname, 'src', 'dashboard.js'),
main: path.join(__dirname, 'src', 'main.js'),
loader: path.join(__dirname, 'src', 'mainLoader.js'),
'files-sidebar': [
path.join(__dirname, 'src', 'mainFilesSidebar.js'),
path.join(__dirname, 'src', 'mainFilesSidebarLoader.js'),
],
}
webpackConfig.output.assetModuleFilename = '[name][ext]?v=[contenthash]'
// Edit JS rule
webpackRules.RULE_JS.exclude = BabelLoaderExcludeNodeModulesExcept([
'@nextcloud/vue-richtext',
'@nextcloud/event-bus',
'ansi-regex',
'color.js',
'fast-xml-parser',
'hot-patcher',
'nextcloud-vue-collections',
'semver',
'strip-ansi',
'tributejs',
'vue-resize',
'webdav',
])
webpackRules.rawLoader = {
resourceQuery: /raw/,
type: 'asset/source',
}
// Replaces rules array
webpackConfig.module.rules = Object.values(webpackRules)
webpackConfig.cache = true
module.exports = webpackConfig