-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack-base.config.js
43 lines (40 loc) · 1007 Bytes
/
webpack-base.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
// @ts-check
const path = require('path');
const TsConfigPathsPlugin = require('tsconfig-paths-webpack-plugin').default;
const webpack = require('webpack');
const { getPkgVersion } = require('./get-pkg-version');
/**
* @type {webpack.Configuration}
*/
const webpackBaseConfig = {
devtool: false,
mode: 'development',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
},
],
},
resolve: {
extensions: ['.js', '.json', '.ts', '.tsx'],
plugins: [
new TsConfigPathsPlugin({
configFile: path.join(__dirname, './tsconfig.json'),
}),
],
},
resolveLoader: {
modules: [path.join(__dirname, '../node_modules'), 'node_modules'],
},
plugins: [
new webpack.DefinePlugin({
'process.env.REACT_VERSION': JSON.stringify(getPkgVersion('react')),
'process.env.FEATURE_HUB_REACT_VERSION': JSON.stringify(
getPkgVersion('@feature-hub/react'),
),
}),
],
};
module.exports = webpackBaseConfig;