forked from looker-open-source/embed-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack-devserver.config.js
61 lines (58 loc) · 1.3 KB
/
webpack-devserver.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
54
55
56
57
58
59
60
61
var path = require('path')
var config = require('./config')
const webpack = require('webpack')
var user = require('./demo/demo_user.json')
var { addRoutes } = require('./server/routes')
var webpackConfig = {
mode: 'development',
devtool: 'source-map',
entry: {
demo: './demo/demo.ts',
message_example: './demo/message_example.ts',
},
output: {
filename: '[name].js',
path: path.join(__dirname, 'demo'),
},
resolve: {
extensions: ['.ts', '.js'],
alias: {
config: path.join(__dirname, './config.js'),
},
},
module: {
rules: [
{
test: /\.ts$/,
loader: 'ts-loader',
options: {
compilerOptions: {
declaration: false,
},
},
},
],
},
plugins: [
new webpack.EnvironmentPlugin({
LOOKER_EMBED_HOST: null,
LOOKER_DASHBOARD_ID: null,
LOOKER_LOOK_ID: null,
LOOKER_EXPLORE_ID: null,
LOOKER_EXTENSION_ID: null,
LOOKER_COOKIELESS_ENABLED: null,
LOOKER_USE_EMBED_DOMAIN: null,
}),
],
devServer: {
compress: true,
contentBase: [path.join(__dirname, 'demo')],
host: config.demo_host,
port: config.demo_port,
watchContentBase: true,
before: (app) => {
addRoutes(app, config, user)
},
},
}
module.exports = webpackConfig