This repository was archived by the owner on Apr 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.babel.js
More file actions
46 lines (44 loc) · 1.91 KB
/
webpack.config.babel.js
File metadata and controls
46 lines (44 loc) · 1.91 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
import HtmlWebpackPlugin from 'html-webpack-plugin';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import path from 'path';
import paths from './config';
const HTMLWebpackPluginConfig = new HtmlWebpackPlugin({
template: path.join(paths.src, 'index.html'),
name: 'index.html',
inject: 'body'
});
export default {
entry: [
path.join(__dirname, '/app/index.js')
],
devtool: "cheap-inline-module-source-map",
devServer: {
historyApiFallback: true,
},
resolve: {
extensions: ['.js', '.css', '.scss']
},
module: {
loaders: [
{ test: /\.jsx?$/, exclude: /node_modules/, loader: "babel-loader" },
{ test: /\.css$/, include: /node_modules/, loader: "style-loader!css-loader" },
{ test: /\.jpe?g$|\.gif$|\.png$|\.svg$|\.woff$|\.ttf$|\.wav$|\.mp3$/, exclude: /node_modules/, loader: "file-loader?name=[name].[ext]" }
]
},
output: {
path: paths.public,
filename: 'app.js'
},
plugins: [
HTMLWebpackPluginConfig,
new CopyWebpackPlugin([
{ from: path.join(paths.src, "css"), to: path.join(paths.public, "css") },
{ from: path.join(__dirname + "/node_modules/leaflet/dist", "images"), to: path.join(paths.public + "/css", "images") },
{ from: __dirname + "/node_modules/leaflet/dist/leaflet.css", to: path.join(paths.public, "css") },
{ from: __dirname + "/node_modules/leaflet.markercluster/dist/MarkerCluster.css", to: path.join(paths.public, "css") },
{ from: __dirname + "/node_modules/leaflet-dialog/Leaflet.Dialog.css", to: path.join(paths.public, "css") },
{ from: __dirname + "/node_modules/leaflet.markercluster/dist/MarkerCluster.Default.css", to: path.join(paths.public, "css") }
])
]
}