AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 1 | 'use strict'; |
| 2 | |
| 3 | let path = require('path'); |
| 4 | |
| 5 | let localDevConfig = {}; |
| 6 | try { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 7 | localDevConfig = require('./devConfig'); |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 8 | } catch (e) { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 9 | console.log('Could not find local dev config.'); |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 10 | } |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 11 | let devConfig = Object.assign( |
| 12 | {}, |
| 13 | require('./devConfig.defaults'), |
| 14 | localDevConfig |
| 15 | ); |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 16 | module.exports = { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 17 | entry: devConfig.bundles, |
| 18 | resolve: { |
| 19 | modules: [path.resolve('.'), path.join(__dirname, 'node_modules')], |
| 20 | alias: { |
| 21 | i18nJson: 'nfvo-utils/i18n/en.json', // only for default build, not through gulp |
| 22 | 'nfvo-utils': 'src/nfvo-utils', |
| 23 | 'nfvo-components': 'src/nfvo-components', |
| 24 | 'sdc-app': 'src/sdc-app', |
| 25 | 'react-select/dist/': 'node_modules/react-select/dist/', |
| 26 | jquery: 'node_modules/restful-js/node_modules/jquery' |
| 27 | } |
| 28 | }, |
| 29 | module: { |
| 30 | rules: [ |
| 31 | { |
| 32 | test: /\.(js|jsx)$/, |
| 33 | loader: 'source-map-loader', |
| 34 | exclude: [ |
| 35 | /node_modules/, |
| 36 | path.resolve(__dirname, '../dox-sequence-diagram/') |
| 37 | ], |
| 38 | enforce: 'pre' |
| 39 | }, |
| 40 | { |
| 41 | test: /\.(js|jsx)$/, |
| 42 | use: [ |
| 43 | { loader: 'babel-loader' }, |
| 44 | { loader: 'eslint-loader', options: { fix: false } } |
| 45 | ], |
| 46 | exclude: [ |
| 47 | /node_modules/, |
| 48 | path.resolve(__dirname, '../dox-sequence-diagram/') |
| 49 | ] |
| 50 | }, |
| 51 | { |
| 52 | test: /\.(css|scss)$/, |
| 53 | use: [ |
| 54 | { loader: 'style-loader' }, |
| 55 | { loader: 'css-loader?sourceMap' }, |
| 56 | { |
| 57 | loader: 'sass-loader?sourceMap', |
| 58 | options: { |
| 59 | output: { path: path.join(__dirname, 'dist') } |
| 60 | } |
| 61 | } |
| 62 | ] |
| 63 | }, |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 64 | |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 65 | // required for font icons |
| 66 | { |
| 67 | test: /\.(woff|woff2)(\?.*)?$/, |
| 68 | loader: 'url-loader?limit=16384&mimetype=application/font-woff' |
| 69 | }, |
| 70 | { test: /\.(ttf|eot|otf)(\?.*)?$/, loader: 'file-loader' }, |
| 71 | { |
| 72 | test: /\.(png|jpg|svg)(\?.*)?$/, |
| 73 | loader: 'url-loader?limit=16384', |
| 74 | exclude: path.join(__dirname, 'resources/images/svg') |
| 75 | }, |
| 76 | { test: /\.html$/, use: [{ loader: 'html-loader' }] } |
| 77 | ] |
| 78 | }, |
| 79 | plugins: [] |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 80 | }; |