-
Notifications
You must be signed in to change notification settings - Fork 962
/
webpack.config.js
45 lines (45 loc) · 979 Bytes
/
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
const path = require('path');
module.exports = {
entry: `./src/components/index.tsx`,
externals: {
react: 'react',
'@builder.io/sdk': '@builder.io/sdk',
'@material-ui/core': '@material-ui/core',
'@emotion/core': '@emotion/core',
'@emotion/styled': '@emotion/styled',
},
output: {
filename: 'builder-plugin-async-dropdown.system.js',
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'system',
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx'],
},
module: {
rules: [
{
test: /\.(ts|tsx)$/,
exclude: /node_modules/,
use: [
{
loader: 'ts-loader',
},
],
},
{
enforce: 'pre',
test: /\.js$/,
loader: 'source-map-loader',
},
],
},
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: true,
port: 1268,
headers: {
'Access-Control-Allow-Origin': '*',
},
},
};