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 { |
| 7 | localDevConfig = require('./devConfig'); |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 8 | } catch (e) { |
| 9 | console.log('Could not find local dev config.'); |
| 10 | } |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 11 | let devConfig = Object.assign({}, require('./devConfig.defaults'), localDevConfig); |
| 12 | |
| 13 | module.exports = { |
| 14 | entry: devConfig.bundles, |
| 15 | resolve: { |
| 16 | modules: [path.resolve('.'), path.join(__dirname, 'node_modules')], |
| 17 | alias: { |
Avi Ziv | b8e2faf | 2017-07-18 19:45:38 +0300 | [diff] [blame] | 18 | i18nJson: 'nfvo-utils/i18n/en.json', // only for default build, not through gulp |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 19 | '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: [ |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 28 | {test: /\.(js|jsx)$/, loader: 'source-map-loader', exclude: [/node_modules/, path.resolve(__dirname, '../dox-sequence-diagram/')], enforce: 'pre'}, |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 29 | {test: /\.(js|jsx)$/, use: [ |
| 30 | {loader : 'react-hot-loader'}, |
| 31 | {loader : 'babel-loader'}, |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 32 | {loader : 'eslint-loader'}], exclude: [/node_modules/, path.resolve(__dirname, '../dox-sequence-diagram/')]}, |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 33 | {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 | }; |