-
Notifications
You must be signed in to change notification settings - Fork 58
/
webpack.common.config.cjs
82 lines (81 loc) · 1.75 KB
/
webpack.common.config.cjs
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 ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
// const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
devServer: {
server: 'https'
},
resolve: {
extensions: [
'.ts',
'.tsx',
'.js',
'.json'
],
plugins: [
new TsconfigPathsPlugin({
configFile: path.join(__dirname, './tsconfig.json')
})
],
fallback: {
buffer: require.resolve('buffer/'),
}
},
module: {
rules: [{
test: /\.(ts|tsx)$/,
use: 'babel-loader'
}, {
test: /\.m?js$/,
resolve: {
fullySpecified: false
}
}, {
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
}, {
test: /\.less$/,
use: [
'style-loader',
'css-loader',
{
loader: 'less-loader',
options: {
lessOptions: {
javascriptEnabled: true
}
}
}
]
}, {
test: /\.(jpe?g|png|gif|ico)$/i,
type: 'asset/resource',
generator: {
filename: 'img/[name].[ext]'
}
}, {
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
type: 'asset/resource'
}, {
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
type: 'asset/resource'
}]
},
plugins: [
new ForkTsCheckerWebpackPlugin({
async: false
})
]
// Uncomment the following lines if you're working with a linked
// @terrestris/ol-util package (or any other package that requires ol
// itself).
// resolve: {
// alias: {
// 'ol': path.join(__dirname, './node_modules', 'ol')
// }
// }
};