-
Notifications
You must be signed in to change notification settings - Fork 30
/
webpack.dev.js
60 lines (60 loc) · 1.52 KB
/
webpack.dev.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
54
55
56
57
58
59
60
const { merge } = require('webpack-merge')
const common = require('./webpack.common.js')
const webpack = require('webpack')
const path = require('path')
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin')
module.exports = merge(common, {
mode: 'development',
devtool: 'inline-source-map',
devServer: {
static: './dist',
},
plugins: [
new webpack.DefinePlugin({
'process.env': JSON.stringify({
browser: true,
CLICKHOUSE_TEST_ENVIRONMENT: process.env.CLICKHOUSE_TEST_ENVIRONMENT,
CLICKHOUSE_CLOUD_HOST: process.env.CLICKHOUSE_CLOUD_HOST,
CLICKHOUSE_CLOUD_PASSWORD: process.env.CLICKHOUSE_CLOUD_PASSWORD,
CLICKHOUSE_CLOUD_JWT_ACCESS_TOKEN: process.env.CLICKHOUSE_CLOUD_JWT_ACCESS_TOKEN,
}),
}),
],
module: {
rules: [
{
test: /\.ts$/,
use: [
{
loader: 'ts-loader',
options: {
transpileOnly: true
}
}
],
exclude: [/node_modules/, /\*\*\/client-node/],
},
],
},
resolve: {
extensions: [
'.ts',
'.js', // for 3rd party modules in node_modules
],
plugins: [
new TsconfigPathsPlugin({
configFile: 'tsconfig.dev.json',
logLevel: 'ERROR',
}),
],
},
output: {
path: path.resolve(__dirname, './webpack'),
// filename: 'browser.js',
libraryTarget: 'umd',
globalObject: 'this',
libraryExport: 'default',
umdNamedDefine: true,
library: 'clickhouse-js',
},
})