forked from linode/linode-api-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.dev.js
79 lines (77 loc) · 1.92 KB
/
webpack.config.dev.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
var path = require('path');
var process = require('process');
var webpack = require('webpack');
var _package = require('./package.json');
module.exports = {
context: __dirname,
node: {
__filename: true,
},
devtool: 'module-eval-source-map',
entry: [
'eventsource-polyfill', // necessary for hot reloading with IE
'webpack-hot-middleware/client',
'./src/index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify(process.env.NODE_ENV)
},
'ENV_API_ROOT': JSON.stringify(process.env.API_ROOT),
'ENV_LOGIN_ROOT': JSON.stringify(process.env.LOGIN_ROOT),
'ENV_API_VERSION': JSON.stringify(process.env.API_VERSION),
'ENV_GA_ID': JSON.stringify(process.env.GA_ID),
'ENV_VERSION': JSON.stringify(_package.version)
})
],
module: {
rules: [
{
test: /\.json$/,
use: ['json-loader'],
},
{
test: /\.jsx?/,
use: ['babel-loader'],
include: [
path.join(__dirname, 'src'),
path.resolve(__dirname, './node_modules/linode-components'),
path.resolve(__dirname, '../components'),
]
},
{
test: /\.s?css$/,
use: [
'style-loader',
'css-loader',
{
loader: 'sass-loader',
options: {
includePaths: [
path.resolve(__dirname, './node_modules/bootstrap/scss/')
]
}
}
],
},
{
test: /\.svg$/,
loader: ['file-loader'],
include: path.join(__dirname, 'node_modules')
}
]
},
resolve: {
alias: {
'react': path.join(__dirname, 'node_modules', 'react')
}
}
};