-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.config.js
43 lines (38 loc) · 1.15 KB
/
webpack.dev.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
// help: http://webpack.github.io/docs/configuration.html
// help: https://webpack.github.io/docs/webpack-dev-server.html#webpack-dev-server-cli
const path = require('path');
const webpack = require('webpack');
const loaders = require('./webpack.loaders');
const plugins = require('./webpack.plugins');
const serverPort = Number(process.argv[process.argv.length - 1]);
console.log('To debug open address: http://localhost:' + serverPort + ' on any browser');
console.log('');
const config = {
entry: [
'babel-polyfill',
'webpack-dev-server/client?http://localhost:'+serverPort,
// todo: tttt -> 'webpack/hot/dev-server',
path.resolve(__dirname, 'dev/index.tsx')
],
devServer: {
hot: true,
port: serverPort,
publicPath: '/static',
historyApiFallback: true
},
output: {
path: path.resolve(__dirname, 'dev/public/static'),
filename: 'bundle.js'
},
resolve: {
alias: {},
extensions: [".webpack.js", ".web.js", ".ts", ".tsx", ".js", ".jsx"]
},
module: {
loaders: loaders
},
plugins: [
// todo: tttt -> new webpack.HotModuleReplacementPlugin()
].concat(plugins),
};
module.exports = config;