Matteo Scandolo | fb46ae6 | 2017-08-08 09:10:50 -0700 | [diff] [blame] | 1 | |
| 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 Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 19 | module.exports = { |
| 20 | module: { |
| 21 | preLoaders: [ |
| 22 | { |
| 23 | test: /\.ts$/, |
| 24 | exclude: /node_modules/, |
| 25 | loader: 'tslint' |
| 26 | } |
| 27 | ], |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 28 | loaders: [ |
| 29 | { |
| 30 | test: /.json$/, |
| 31 | loaders: [ |
| 32 | 'json' |
| 33 | ] |
| 34 | }, |
| 35 | { |
| 36 | test: /\.ts$/, |
| 37 | exclude: /node_modules/, |
| 38 | loaders: [ |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 39 | 'ng-annotate', |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 40 | 'ts' |
| 41 | ] |
| 42 | }, |
| 43 | { |
| 44 | test: /.html$/, |
| 45 | loaders: [ |
Matteo Scandolo | d62ea79 | 2016-12-22 14:02:28 -0800 | [diff] [blame] | 46 | 'html?' + JSON.stringify({ |
| 47 | attrs: ["img:src", "img:ng-src"] |
| 48 | }) |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 49 | ] |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 50 | }, |
| 51 | { |
| 52 | test: /\.(css|scss)$/, |
| 53 | loaders: [ |
| 54 | 'style', |
| 55 | 'css', |
| 56 | 'sass', |
| 57 | 'postcss' |
| 58 | ] |
Matteo Scandolo | 266907e | 2016-12-20 13:41:42 -0800 | [diff] [blame] | 59 | }, |
| 60 | { |
| 61 | test: /\.(png|woff|woff2|eot|ttf|svg|jpg|gif|jpeg)$/, |
| 62 | loader: 'url-loader?limit=100000' |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 63 | } |
Matteo Scandolo | 70377e5 | 2017-04-10 16:41:28 -0700 | [diff] [blame] | 64 | ], |
| 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 Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 71 | ] |
| 72 | }, |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 73 | plugins: [], |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 74 | debug: true, |
Matteo Scandolo | 70377e5 | 2017-04-10 16:41:28 -0700 | [diff] [blame] | 75 | devtool: false, |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 76 | resolve: { |
| 77 | extensions: [ |
| 78 | '', |
| 79 | '.webpack.js', |
| 80 | '.web.js', |
| 81 | '.js', |
| 82 | '.ts' |
| 83 | ] |
| 84 | }, |
| 85 | ts: { |
Matteo Scandolo | 70377e5 | 2017-04-10 16:41:28 -0700 | [diff] [blame] | 86 | configFileName: 'tsconfig.test.json' |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 87 | }, |
| 88 | tslint: { |
| 89 | configuration: require('../tslint.json') |
| 90 | } |
| 91 | }; |