forked from creevey/creevey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.ts
36 lines (34 loc) · 1.07 KB
/
webpack.config.ts
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
import path from 'path';
import { Configuration, DefinePlugin } from 'webpack';
const config: Configuration = {
entry: [require.resolve('core-js'), require.resolve('regenerator-runtime/runtime'), './src/client/web/index.tsx'],
output: { path: path.join(__dirname, './lib/cjs/client/web') },
module: {
rules: [
{
test: /\.tsx?/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
overrides: [
{
// TODO Don't need, see https://babeljs.io/docs/en/babel-preset-env#usebuiltins-entry
presets: [['@babel/preset-env', { useBuiltIns: 'entry', corejs: 3 }]],
},
],
},
},
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.jsx', '.js'],
},
devServer: { port: 8000, proxy: { '/': { target: 'http://localhost:3000' } } },
...(process.env.WEBPACK_DEV_SERVER
? { plugins: [new DefinePlugin({ __CREEVEY_SERVER_PORT__: JSON.stringify('3000') })] }
: {}),
performance: false,
};
export default config;