forked from nextcloud/groupfolders
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.js
38 lines (33 loc) Β· 931 Bytes
/
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
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const path = require('path')
const webpackConfig = require('@nextcloud/webpack-vue-config')
const webpackRules = require('@nextcloud/webpack-vue-config/rules')
webpackConfig.entry.main = path.resolve(path.join('src', 'main.ts'))
webpackConfig.entry.settings = [
'whatwg-fetch',
'./src/settings/index.tsx',
]
webpackConfig.entry.files = [
'./src/files.js',
]
webpackConfig.resolve.extensions = [...webpackConfig.resolve.extensions, '.jsx', '.ts', '.tsx']
webpackConfig.plugins.push(new CleanWebpackPlugin())
webpackRules.RULE_TSX = {
test: /\.tsx?$/,
use: [
{
loader: 'babel-loader',
options: {
babelrc: false,
plugins: ['react-hot-loader/babel'],
},
},
'ts-loader',
],
}
webpackRules.RULE_RAW = {
resourceQuery: /raw/,
type: 'asset/source',
}
webpackConfig.module.rules = Object.values(webpackRules)
module.exports = webpackConfig