Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 1 | module.exports = { |
| 2 | module: { |
| 3 | preLoaders: [ |
| 4 | { |
| 5 | test: /\.ts$/, |
| 6 | exclude: /node_modules/, |
| 7 | loader: 'tslint' |
| 8 | } |
| 9 | ], |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 10 | loaders: [ |
| 11 | { |
| 12 | test: /.json$/, |
| 13 | loaders: [ |
| 14 | 'json' |
| 15 | ] |
| 16 | }, |
| 17 | { |
| 18 | test: /\.ts$/, |
| 19 | exclude: /node_modules/, |
| 20 | loaders: [ |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 21 | 'ng-annotate', |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 22 | 'ts' |
| 23 | ] |
| 24 | }, |
| 25 | { |
| 26 | test: /.html$/, |
| 27 | loaders: [ |
Matteo Scandolo | d62ea79 | 2016-12-22 14:02:28 -0800 | [diff] [blame] | 28 | 'html?' + JSON.stringify({ |
| 29 | attrs: ["img:src", "img:ng-src"] |
| 30 | }) |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 31 | ] |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 32 | }, |
| 33 | { |
| 34 | test: /\.(css|scss)$/, |
| 35 | loaders: [ |
| 36 | 'style', |
| 37 | 'css', |
| 38 | 'sass', |
| 39 | 'postcss' |
| 40 | ] |
Matteo Scandolo | 266907e | 2016-12-20 13:41:42 -0800 | [diff] [blame] | 41 | }, |
| 42 | { |
| 43 | test: /\.(png|woff|woff2|eot|ttf|svg|jpg|gif|jpeg)$/, |
| 44 | loader: 'url-loader?limit=100000' |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 45 | } |
Matteo Scandolo | 70377e5 | 2017-04-10 16:41:28 -0700 | [diff] [blame] | 46 | ], |
| 47 | postLoaders : [ |
| 48 | { |
| 49 | test: /\.ts$/, |
| 50 | exclude: /(node_modules|tests|(.spec\.ts))/, |
| 51 | loader: 'istanbul-instrumenter' // used to to get the code coverage for TypeScript |
| 52 | } |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 53 | ] |
| 54 | }, |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 55 | plugins: [], |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 56 | debug: true, |
Matteo Scandolo | 70377e5 | 2017-04-10 16:41:28 -0700 | [diff] [blame] | 57 | devtool: false, |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 58 | resolve: { |
| 59 | extensions: [ |
| 60 | '', |
| 61 | '.webpack.js', |
| 62 | '.web.js', |
| 63 | '.js', |
| 64 | '.ts' |
| 65 | ] |
| 66 | }, |
| 67 | ts: { |
Matteo Scandolo | 70377e5 | 2017-04-10 16:41:28 -0700 | [diff] [blame] | 68 | configFileName: 'tsconfig.test.json' |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 69 | }, |
| 70 | tslint: { |
| 71 | configuration: require('../tslint.json') |
| 72 | } |
| 73 | }; |