forked from nusantarachain/arascan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
46 lines (45 loc) · 1.08 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
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
/** @type import('webpack').Configuration */
module.exports = {
devtool: 'source-map',
context: __dirname,
module: {
rules: [
{
test: /\.js$/,
enforce: 'pre',
loader: 'source-map-loader',
},
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: {
projectReferences: true,
configFile: require.resolve('./tsconfig.json'),
compilerOptions: {
// build still catches these. avoid them during bunding time for a nicer dev experience.
noUnusedLocals: false,
noUnusedParameters: false,
},
},
},
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, 'css-loader'],
},
{
test: /\.(png|jpe?g|gif|svg)$/,
loader: 'file-loader',
},
],
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json'],
},
plugins: [
new MiniCssExtractPlugin({
filename: '[name].css',
chunkFilename: '[name].css',
}),
]
};