-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.base.js
More file actions
37 lines (34 loc) · 983 Bytes
/
webpack.config.base.js
File metadata and controls
37 lines (34 loc) · 983 Bytes
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
// Copyright (c) 2020-present grommunio GmbH. All Rights Reserved.
const path = require('path')
const ESLintPlugin = require("eslint-webpack-plugin")
const isProduction = process.env.NODE_ENV === 'production';
module.exports = {
isProduction,
outputPath: path.resolve(__dirname, 'build'),
baseConfig: {
mode: isProduction ? 'production' : 'development',
module: {
rules: [{
test: /\.(js|jsx|ts|tsx)$/,
include: path.resolve(__dirname, "src"),
use: [
{
loader: 'babel-loader', // babel-loader uses polyfills (which ts-loader doesn't)
},
],
}],
},
devtool: isProduction ? undefined : 'inline-source-map',
resolve: {
roots: [path.resolve(__dirname)],
extensions: ['.js', '.jsx', '.tsx', '.ts', '.scss'],
modules: ['node_modules'],
},
plugins: [
new ESLintPlugin({
extensions: ['.ts', '.tsx'],
files: ['src/']
}),
],
},
}