-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
71 lines (67 loc) · 2.25 KB
/
webpack.config.dev.js
File metadata and controls
71 lines (67 loc) · 2.25 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
const { resolve } = require('path');
const webpack = require("webpack");
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
devtool: 'source-map',
entry: [
'react-hot-loader/patch',
'webpack-dev-server/client',
'webpack/hot/only-dev-server',
'./src/emulator-app.js'
],
output: {
path: resolve(__dirname, 'public'),
publicPath: '/',
filename: 'bundle.js',
},
devServer: {
host: '0.0.0.0',
hot: true,
contentBase: resolve(__dirname, 'public'),
publicPath: '/',
},
resolve: {
// Allowed implicit extensions for require/import
extensions: ['.js', '.jsx']
},
plugins: [
new CopyWebpackPlugin([
{ context: 'node_modules/@anyware/sound-assets',
from: '**/*.wav',
to: 'sounds',
},
{ context: 'images',
from: 'disk*.png',
to: 'images'
},
{ from: 'config.js' },
]),
new HtmlWebpackPlugin({
inject: false, // Done by html-webpack-template
template: require('html-webpack-template'),
title: 'anyWare Emulator',
appMountId: 'content',
favicon: 'images/favicon.ico',
scripts: ['/config.js'],
}),
new webpack.HotModuleReplacementPlugin()
],
module: {
rules: [
{ test: /\.jsx?$/,
exclude: /node_modules/,
use: ['babel-loader'],
},
// General purpose CSS loader, needed by e.g. react-bootstrap-table
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
// General purpose LESS loader, needed by e.g. bootstrap and our own less stylesheets
{ test: /\.less$/, use: ['style-loader', 'css-loader', 'less-loader'] },
// The following 5 rules are needed by bootstrap
{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, use: ['file-loader'] },
{ test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/, use: [{loader: 'url-loader', options: {limit: 10000, mimetype: 'application/font-woff'}}] },
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, use: [{loader: 'url-loader', options: {limit: 10000, mimetype: 'application/octet-stream'}}] },
{ test: /\.svg$/, use: ['babel-loader', {loader: 'react-svg-loader', options: {jsx: true, svgo: {plugins: [{cleanupIDs: false}]}}}] },
]
}
};