-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebviews.webpack.config.js
53 lines (51 loc) · 1.28 KB
/
webviews.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
/* eslint-disable */
const path = require('path')
const isProduction = process.env.NODE_ENV === 'production'
const port = 8378
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
module.exports = {
mode: isProduction ? 'production' : 'development',
entry: {
SearchReplaceView: './src/SearchReplaceView/SearchReplaceViewEntry.tsx',
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'out'),
...(isProduction ? {} : { publicPath: `http://0.0.0.0:${port}/` }),
},
devtool: 'inline-source-map',
devServer: {
hot: true,
port,
allowedHosts: 'all',
headers: {
'Access-Control-Allow-Origin': '*',
},
},
resolve: {
mainFields: ['browser', 'module', 'main'], // look for `browser` entry point in imported node modules
importsFields: ['browser', 'module', 'main'],
extensions: ['.js', '.ts', '.tsx'],
},
plugins: [new MiniCssExtractPlugin()],
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
use: [
{
loader: 'ts-loader',
options: {
transpileOnly: true,
},
},
],
},
{
test: /\.css$/i,
use: [MiniCssExtractPlugin.loader, 'css-loader'],
},
],
},
}