forked from nextcloud/appstore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
54 lines (52 loc) · 1.92 KB
/
webpack.config.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
47
48
49
50
51
52
53
54
const CopyWebpackPlugin = require('copy-webpack-plugin');
const webpack = require('webpack');
const base = './nextcloudappstore/core/static/';
module.exports = {
entry: {
'app/list': `${base}assets/app/app/views/List.ts`,
'app/detail': `${base}assets/app/app/views/Detail.ts`,
'app/register': `${base}assets/app/app/views/Register.ts`,
'app/upload': `${base}assets/app/app/views/Upload.ts`,
'app/releases': `${base}assets/app/app/views/Releases.ts`,
'user/token': `${base}assets/app/user/views/Token.ts`
},
output: {
path: __dirname,
filename: `${base}public/[name].js`
},
resolve: {
// Add '.ts' and '.tsx' as a resolvable extension.
extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js']
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader'
}
]
},
plugins: [
// we dont care about bootstrap, jquery or polyfills, just copy it from
// node_modules to the vendor directory for each page load to include
new CopyWebpackPlugin([
{from: 'node_modules/bootstrap/dist/fonts', to: `${base}vendor/bootstrap/dist/fonts`},
{
from: 'node_modules/bootstrap/dist/css/bootstrap.min.css',
to: `${base}vendor/bootstrap/dist/css/bootstrap.min.css`
},
{
from: 'node_modules/bootstrap.native/dist/bootstrap-native.min.js',
to: `${base}vendor/bootstrap.native.min.js`
},
{
from: 'node_modules/highlight.js/styles/github.css',
to: `${base}vendor/github.css`
},
]),
new webpack.NormalModuleReplacementPlugin(
/node_modules\/highlight\.js\/lib\/index\.js/,
'../../../nextcloudappstore/core/static/assets/patches/hl.js'
)
]
};