blob: 68d89234588e84eed28535fbd05c7cf03d790379 [file] [log] [blame]
AviZi280f8012017-06-09 02:39:56 +03001'use strict';
2
3let path = require('path');
4
5let localDevConfig = {};
6try {
7 localDevConfig = require('./devConfig');
talig8e9c0652017-12-20 14:30:43 +02008} catch (e) {
9 console.log('Could not find local dev config.');
10}
AviZi280f8012017-06-09 02:39:56 +030011let devConfig = Object.assign({}, require('./devConfig.defaults'), localDevConfig);
12
13module.exports = {
14 entry: devConfig.bundles,
15 resolve: {
16 modules: [path.resolve('.'), path.join(__dirname, 'node_modules')],
17 alias: {
Avi Zivb8e2faf2017-07-18 19:45:38 +030018 i18nJson: 'nfvo-utils/i18n/en.json', // only for default build, not through gulp
AviZi280f8012017-06-09 02:39:56 +030019 'nfvo-utils': 'src/nfvo-utils',
20 'nfvo-components': 'src/nfvo-components',
21 'sdc-app': 'src/sdc-app',
22 'react-select/dist/' : 'node_modules/react-select/dist/',
23 'jquery' : 'node_modules/restful-js/node_modules/jquery'
24 }
25 },
26 module: {
27 rules: [
talig8e9c0652017-12-20 14:30:43 +020028 {test: /\.(js|jsx)$/, loader: 'source-map-loader', exclude: [/node_modules/, path.resolve(__dirname, '../dox-sequence-diagram/')], enforce: 'pre'},
AviZi280f8012017-06-09 02:39:56 +030029 {test: /\.(js|jsx)$/, use: [
30 {loader : 'react-hot-loader'},
31 {loader : 'babel-loader'},
talig8e9c0652017-12-20 14:30:43 +020032 {loader : 'eslint-loader'}], exclude: [/node_modules/, path.resolve(__dirname, '../dox-sequence-diagram/')]},
AviZi280f8012017-06-09 02:39:56 +030033 {test: /\.(css|scss)$/, use: [
34 {loader: 'style-loader'},
35 {loader: 'css-loader?sourceMap'},
36 {loader: 'sass-loader?sourceMap', options: { output: { path: path.join(__dirname, 'dist') } }}]},
37
38 // required for font icons
39 {test: /\.(woff|woff2)(\?.*)?$/, loader: 'url-loader?limit=16384&mimetype=application/font-woff'},
40 {test: /\.(ttf|eot|otf)(\?.*)?$/, loader: 'file-loader'},
41 {test: /\.(png|jpg|svg)(\?.*)?$/, loader: 'url-loader?limit=16384', exclude: path.join(__dirname, 'resources/images/svg') },
42 {test: /\.html$/, use: [ {loader: 'html-loader'}]}
43 ]
44 },
45 plugins: []
46};