-
Notifications
You must be signed in to change notification settings - Fork 420
/
Copy pathwebpack.common.js
43 lines (42 loc) · 969 Bytes
/
webpack.common.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
import path from 'path';
export default {
entry: './src/index.ts',
output: {
path: path.resolve('./dist'),
filename: 'sql-formatter.cjs',
library: 'sqlFormatter',
libraryTarget: 'umd',
globalObject: 'this',
},
resolve: {
extensions: ['.js', '.ts'],
extensionAlias: {
'.js': ['.ts', '.js'],
},
},
module: {
rules: [
{
test: /\.ts$/u,
exclude: /node_modules/u,
use: [
'babel-loader',
{
loader: 'ts-loader',
options: {
// Prevent `ts-loader` from emitting types to the `lib` directory.
// This also disables type-checking, which is already performed
// independently of the webpack build process.
transpileOnly: true,
},
},
],
},
{
test: /\.js$/u,
exclude: /node_modules/u,
use: ['babel-loader'],
},
],
},
};