-
Notifications
You must be signed in to change notification settings - Fork 87
/
webpack.js
44 lines (39 loc) Β· 1.01 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
/**
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
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 = {
init: path.resolve(path.join('src', 'init.ts')),
files: [
'./src/files.js',
],
settings: [
'whatwg-fetch',
'./src/settings/index.tsx',
],
}
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