-
Notifications
You must be signed in to change notification settings - Fork 18
/
webpack.webview.config.js
66 lines (63 loc) · 1.73 KB
/
webpack.webview.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
55
56
57
58
59
60
61
62
63
64
65
66
/* eslint-env node */
const { VueLoaderPlugin } = require('vue-loader');
module.exports = {
module: {
rules: [
{
test: /\.css$/,
loader: [
'style-loader',
'css-loader',
{
loader: 'postcss-loader',
options: { postcssOptions: { config: './src/driver/webview/postcss.config.js' } },
},
],
},
{
test: /\.vue$/,
loader: 'vue-loader',
},
{
test: /\.tsx?$/,
exclude: {
and: [/node_modules/],
not: [/lowdb/],
},
loader: 'babel-loader',
options: {
plugins: [
[
'import',
{
libraryName: 'ant-design-vue',
libraryDirectory: 'es',
style: 'css',
},
],
'babel-plugin-transform-typescript-metadata',
['@babel/plugin-proposal-decorators', { legacy: true }],
/* following plugins are for webpack 4 js parser */
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-nullish-coalescing-operator',
],
presets: [
['@babel/preset-typescript', { allExtensions: true }],
[
'@babel/preset-env',
{
useBuiltIns: 'usage',
corejs: 3,
shippedProposals: true,
targets: {
electron: 10, // https://github.com/laurent22/joplin/blob/269ec34c83ba1ffd3f87eac90563779ec35d9e90/packages/app-desktop/package.json#L107
},
},
],
],
},
},
],
},
plugins: [new VueLoaderPlugin()],
};