summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/webpack.common.js
blob: ebe4a8454a347a784b4a4e75711c442616fa45c2 (plain)
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
'use strict';

let path = require('path');

let localDevConfig = {};
try {
	localDevConfig = require('./devConfig');
} catch (e) {}
let devConfig = Object.assign({}, require('./devConfig.defaults'), localDevConfig);

module.exports = {
	entry: devConfig.bundles,
	resolve: {
		modules: [path.resolve('.'), path.join(__dirname, 'node_modules')],
		alias: {
			i18nJson: 'nfvo-utils/i18n/en.json', // only for default build, not through gulp
			'nfvo-utils': 'src/nfvo-utils',
			'nfvo-components': 'src/nfvo-components',
			'sdc-app': 'src/sdc-app',
			'react-select/dist/' : 'node_modules/react-select/dist/',
			'jquery' : 'node_modules/restful-js/node_modules/jquery'
		}
	},
	module: {
		rules: [
			{test: /\.(js|jsx)$/, loader: 'source-map-loader', exclude: /node_modules/, enforce: 'pre'},
			{test: /\.(js|jsx)$/, use: [
				{loader : 'react-hot-loader'},
				{loader : 'babel-loader'},
				{loader : 'eslint-loader'}], exclude: /node_modules/},
			{test: /\.(css|scss)$/, use: [
				{loader: 'style-loader'},
				{loader: 'css-loader?sourceMap'},
				{loader: 'sass-loader?sourceMap', options: { output: { path: path.join(__dirname, 'dist') } }}]},

			// required for font icons
			{test: /\.(woff|woff2)(\?.*)?$/, loader: 'url-loader?limit=16384&mimetype=application/font-woff'},
			{test: /\.(ttf|eot|otf)(\?.*)?$/, loader: 'file-loader'},
			{test: /\.(png|jpg|svg)(\?.*)?$/, loader: 'url-loader?limit=16384', exclude: path.join(__dirname, 'resources/images/svg') },
			{test: /\.html$/, use: [ {loader: 'html-loader'}]}
			]
	},
	plugins: []
};