-
Notifications
You must be signed in to change notification settings - Fork 7
/
webpack.config.js
51 lines (50 loc) · 1.62 KB
/
webpack.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
const HtmlWebpackPlugin = require('html-webpack-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
// entry: __dirname + '/src/index.js',
entry: {
index: __dirname + '/src/index.js',
// vendor: [
// __dirname + '/src/lib/tiff.min.js'
// ],
},
output: {
path: __dirname + '/build',
// publicPath: "/assets/",
filename: '[name].js'
},
devServer: {
contentBase: "./build",
inline: true,
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader"
},
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: "css-loader"
})
},
{ test: /\.(png|jpg)$/, loader: 'url-loader' },
{ test: /\.woff$/, loader: "url-loader?limit=10000&mimetype=application/font-woff" },
{ test: /\.ttf$/, loader: "url-loader?limit=10000&mimetype=application/octet-stream" },
{ test: /\.eot$/, loader: "file-loader" },
{ test: /\.svg$/, loader: "url-loader?limit=10000&mimetype=image/svg+xml" }
]
},
plugins: [
new HtmlWebpackPlugin({
title: 'AI for Earth - LandcoverApp',
template: __dirname + "/src/index.template.html"
}),
new UglifyJsPlugin(),
new ExtractTextPlugin("styles.css")
],
};