-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.js
More file actions
47 lines (44 loc) · 1.15 KB
/
webpack.config.js
File metadata and controls
47 lines (44 loc) · 1.15 KB
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
47
// SPDX-FileCopyrightText: XWiki CryptPad Team <contact@cryptpad.org> and contributors
// SPDX-License-Identifier: AGPL-3.0-or-later
const path = require('path')
const webpackConfig = require('@nextcloud/webpack-vue-config')
const webpack = require('webpack')
webpackConfig.entry.settings = path.resolve(path.join('src', 'settings.js'))
webpackConfig.entry.editor = path.resolve(path.join('src', 'editor.js'))
webpackConfig.entry['public'] = path.resolve(path.join('src', 'public.js'))
webpackConfig.module.rules = [ // taken from https://github.com/nextcloud-libraries/webpack-vue-config/blob/main/rules.js and modified to `source` SVGs
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
{
test: /\.vue$/,
loader: 'vue-loader',
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
},
{
test: /\.tsx?$/,
use: [
'babel-loader',
'ts-loader',
],
exclude: /node_modules/,
},
{
test: /\.(png|jpe?g|gif|woff2?|eot|ttf)$/,
type: 'asset/inline',
},
{
test: /\.svg$/,
type: 'asset/source',
},
];
module.exports = webpackConfig