blob: d1038b66554b5f9be29a9e8fd7e81271dcfa260e [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);
AviZi280f8012017-06-09 02:39:56 +030012module.exports = {
13 entry: devConfig.bundles,
14 resolve: {
15 modules: [path.resolve('.'), path.join(__dirname, 'node_modules')],
16 alias: {
Avi Zivb8e2faf2017-07-18 19:45:38 +030017 i18nJson: 'nfvo-utils/i18n/en.json', // only for default build, not through gulp
AviZi280f8012017-06-09 02:39:56 +030018 'nfvo-utils': 'src/nfvo-utils',
19 'nfvo-components': 'src/nfvo-components',
20 'sdc-app': 'src/sdc-app',
21 'react-select/dist/' : 'node_modules/react-select/dist/',
22 'jquery' : 'node_modules/restful-js/node_modules/jquery'
23 }
24 },
25 module: {
26 rules: [
talig8e9c0652017-12-20 14:30:43 +020027 {test: /\.(js|jsx)$/, loader: 'source-map-loader', exclude: [/node_modules/, path.resolve(__dirname, '../dox-sequence-diagram/')], enforce: 'pre'},
AviZi280f8012017-06-09 02:39:56 +030028 {test: /\.(js|jsx)$/, use: [
AviZi280f8012017-06-09 02:39:56 +030029 {loader : 'babel-loader'},
talig8e9c0652017-12-20 14:30:43 +020030 {loader : 'eslint-loader'}], exclude: [/node_modules/, path.resolve(__dirname, '../dox-sequence-diagram/')]},
AviZi280f8012017-06-09 02:39:56 +030031 {test: /\.(css|scss)$/, use: [
32 {loader: 'style-loader'},
33 {loader: 'css-loader?sourceMap'},
34 {loader: 'sass-loader?sourceMap', options: { output: { path: path.join(__dirname, 'dist') } }}]},
35
36 // required for font icons
37 {test: /\.(woff|woff2)(\?.*)?$/, loader: 'url-loader?limit=16384&mimetype=application/font-woff'},
38 {test: /\.(ttf|eot|otf)(\?.*)?$/, loader: 'file-loader'},
39 {test: /\.(png|jpg|svg)(\?.*)?$/, loader: 'url-loader?limit=16384', exclude: path.join(__dirname, 'resources/images/svg') },
40 {test: /\.html$/, use: [ {loader: 'html-loader'}]}
svishnev9f25b3b2018-01-24 12:14:59 +020041 ]
AviZi280f8012017-06-09 02:39:56 +030042 },
43 plugins: []
44};