-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
74 lines (72 loc) · 1.79 KB
/
webpack.config.dev.js
File metadata and controls
74 lines (72 loc) · 1.79 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
const path = require('path');
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackExternalsPlugin = require('html-webpack-externals-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
module.exports = {
entry: './src/index.tsx',
devtool: 'inline-source-map',
stats: 'errors-warnings',
mode: 'development',
watch: true,
module: {
rules: [
{
test: /\.(t|j)s(x?)$/u,
loader: 'ts-loader',
exclude: /node_modules/,
options: {
transpileOnly: true
}
},
{
test: /\.s[ac]ss$/i,
use: ["style-loader", "css-loader", "sass-loader"],
},
],
},
resolve: {
extensions: [ '.tsx', '.ts', '.js', '.jsx' ],
},
output: {
filename: 'dev.app.bundle.js',
path: path.resolve(__dirname, 'public/build'),
publicPath: '/build/'
},
plugins: [
new HtmlWebpackPlugin({
template: './src/index.html',
path: path.resolve(__dirname, "public"),
filename: '../index.html',
inject: 'head'
}),
new HtmlWebpackExternalsPlugin({
externals: [
{
module: 'aframe',
entry: 'https://aframe.io/releases/1.0.4/aframe.min.js',
global: 'AFRAME',
},
{
module: 'socket.io',
entry: 'https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.slim.js',
global: 'io',
},
{
module: 'open-easyrtc',
entry: 'api/easyrtc.js',
global: 'easyrtc',
},
{
module: 'networked-aframe',
entry: 'https://unpkg.com/networked-aframe@0.8.2/dist/networked-aframe.js',
global: 'NAF',
},
],
}),
new ProgressBarPlugin(),
new NodePolyfillPlugin(),
new ForkTsCheckerWebpackPlugin()
]
};