-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_base.js
49 lines (47 loc) · 1.11 KB
/
_base.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
import webpack from 'webpack';
import { resolve } from 'path';
import fontMagician from 'postcss-font-magician';
import autoprefixer from 'autoprefixer';
import env from '../env';
const IS_DEV = !process.env['NODE_ENV'];
const API_URL = IS_DEV ?
'http://localhost:9292' :
'http://api.toastmasters.hr';
export default {
output: {
path: resolve(__dirname, '../dist'),
filename: 'bundle.js',
publicPath: '/',
},
plugins: [
new webpack.DefinePlugin({
__DEV__: JSON.stringify(IS_DEV),
__API_URL__: JSON.stringify(API_URL),
__API_KEY__: JSON.stringify(env['API_KEY']),
}),
// https://github.com/webpack/webpack/issues/59#issuecomment-12923514
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /hr$/),
],
module: {
loaders: [
{
test: /\.js$/,
loaders: ['babel'],
include: [
resolve(__dirname, '../src'),
resolve(__dirname, '../test'),
],
},
{
test: /\.json$/,
loaders: ['json'],
},
],
},
postcss() {
return [
fontMagician,
autoprefixer,
];
},
};