blob: e35f5b36c6c96c0be65166fdfb66de36fbe83ba4 [file] [log] [blame]
Matteo Scandolofb46ae62017-08-08 09:10:50 -07001
2/*
3 * Copyright 2017-present Open Networking Foundation
4
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8
9 * http://www.apache.org/licenses/LICENSE-2.0
10
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18
Matteo Scandolod819c922016-12-02 14:06:14 -080019module.exports = {
20 module: {
21 preLoaders: [
22 {
23 test: /\.ts$/,
24 exclude: /node_modules/,
25 loader: 'tslint'
26 }
27 ],
Matteo Scandolod819c922016-12-02 14:06:14 -080028 loaders: [
29 {
30 test: /.json$/,
31 loaders: [
32 'json'
33 ]
34 },
35 {
36 test: /\.ts$/,
37 exclude: /node_modules/,
38 loaders: [
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080039 'ng-annotate',
Matteo Scandolod819c922016-12-02 14:06:14 -080040 'ts'
41 ]
42 },
43 {
44 test: /.html$/,
45 loaders: [
Matteo Scandolod62ea792016-12-22 14:02:28 -080046 'html?' + JSON.stringify({
47 attrs: ["img:src", "img:ng-src"]
48 })
Matteo Scandolod819c922016-12-02 14:06:14 -080049 ]
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080050 },
51 {
52 test: /\.(css|scss)$/,
53 loaders: [
54 'style',
55 'css',
56 'sass',
57 'postcss'
58 ]
Matteo Scandolo266907e2016-12-20 13:41:42 -080059 },
60 {
61 test: /\.(png|woff|woff2|eot|ttf|svg|jpg|gif|jpeg)$/,
62 loader: 'url-loader?limit=100000'
Matteo Scandolod819c922016-12-02 14:06:14 -080063 }
Matteo Scandolo70377e52017-04-10 16:41:28 -070064 ],
65 postLoaders : [
66 {
67 test: /\.ts$/,
68 exclude: /(node_modules|tests|(.spec\.ts))/,
69 loader: 'istanbul-instrumenter' // used to to get the code coverage for TypeScript
70 }
Matteo Scandolod819c922016-12-02 14:06:14 -080071 ]
72 },
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080073 plugins: [],
Matteo Scandolod819c922016-12-02 14:06:14 -080074 debug: true,
Matteo Scandolo70377e52017-04-10 16:41:28 -070075 devtool: false,
Matteo Scandolod819c922016-12-02 14:06:14 -080076 resolve: {
77 extensions: [
78 '',
79 '.webpack.js',
80 '.web.js',
81 '.js',
82 '.ts'
83 ]
84 },
85 ts: {
Matteo Scandolo70377e52017-04-10 16:41:28 -070086 configFileName: 'tsconfig.test.json'
Matteo Scandolod819c922016-12-02 14:06:14 -080087 },
88 tslint: {
89 configuration: require('../tslint.json')
90 }
91};