This repository was archived by the owner on Sep 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
59 lines (54 loc) · 1.42 KB
/
webpack.config.js
File metadata and controls
59 lines (54 loc) · 1.42 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
const webpack = require('webpack')
const path = require('path')
const pkg = require('./package.json')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const OfflinePlugin = require('offline-plugin')
const BUILD_DIR = path.resolve(__dirname, 'build')
const APP_DIR = path.resolve(__dirname, 'src')
const API_URL = "https://app.eurofurence.org/Api/v2/"
const enviroment = process.env.NODE_ENV === 'production' ? 'production' : 'development'
const config = {
entry: path.resolve(__dirname, './src/index.jsx'),
output: {
path: BUILD_DIR,
filename: 'bundle.js'
},
resolve: {
extensions: ['.jsx', '.js', '.css'],
},
devServer: {
contentBase: path.resolve(__dirname, 'src'),
},
devtool: 'source-map',
module: {
loaders: [
{
test: /\.jsx?/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.css?/,
loader: ['style-loader', 'css-loader']
}
]
},
externals: {
// Workaround for https://github.com/airbnb/enzyme/issues/47
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true,
},
plugins: [
new HtmlWebpackPlugin({
title: pkg.name,
template: require('html-webpack-template'),
mobile: true
}),
new webpack.DefinePlugin({
'API_URL': JSON.stringify(API_URL),
'NODE_ENV': JSON.stringify(enviroment)
})
]
}
module.exports = config