-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.config.js
82 lines (80 loc) · 2.29 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
const path = require('path');
const htmlWebpackPlugin = require('html-webpack-plugin');
const copyPlugin = require('copy-webpack-plugin');
const packageSettings = require('./package.json');
version = packageSettings.version || '0.0.0';
module.exports = {
mode: 'production',
entry: {
'syntax-highlighter-miro-plugin': './src/miro-plugin/index.ts',
'syntax-highlighter-settings': './src/settings/index.ts'
},
module: {
rules: [
{
test: /\.tsx?$/,
use: {
loader: 'ts-loader',
options: {
transpileOnly: true
}
},
exclude: /node_modules/
},
{
test: /\.theme$/i,
use: 'raw-loader',
exclude: /node_modules/
},
{
test: /\.svg$/,
loader: 'svg-inline-loader',
exclude: /node_modules/
}
]
},
resolve: {
modules: [
path.resolve('./src'),
path.resolve('./node_modules')
],
extensions: ['.tsx', '.ts', '.js','.css']
},
output: {
filename: `[name].js`,
path: path.resolve(__dirname, 'dist')
},
plugins: [
new htmlWebpackPlugin({
template: "./src/pages/settings.html",
filename: "./settings.html",
templateParameters: {
'version': version
},
chunks: ["syntax-highlighter-settings"],
inject: false
}),
new htmlWebpackPlugin({
template: "./src/pages/index.html",
filename: "./index.html",
templateParameters: {
'version': version
},
chunks:["syntax-highlighter-miro-plugin"],
inject: false
}),
new htmlWebpackPlugin({
template: "./src/pages/feedback.html",
filename: "./feedback.html",
templateParameters: {
'version': version
},
inject: false
}),
new copyPlugin({
patterns: [
{ from: "./src/pages/install.html", to: "./install.html" }
]
}),
]
};