blob: 56f261173ae2720a01d65c9c0590ab5dab6df8c9 [file] [log] [blame]
Matteo Scandolod819c922016-12-02 14:06:14 -08001const webpack = require('webpack');
2const conf = require('./gulp.conf');
3const path = require('path');
4
5const HtmlWebpackPlugin = require('html-webpack-plugin');
6const autoprefixer = require('autoprefixer');
7
8module.exports = {
9 module: {
10 preLoaders: [
11 {
12 test: /\.ts$/,
13 exclude: /node_modules/,
14 loader: 'tslint'
15 }
16 ],
17
18 loaders: [
19 {
20 test: /.json$/,
21 loaders: [
22 'json'
23 ]
24 },
25 {
26 test: /\.(css|scss)$/,
27 loaders: [
28 'style',
29 'css',
30 'sass',
31 'postcss'
32 ]
33 },
34 {
35 test: /\.ts$/,
36 exclude: /node_modules/,
37 loaders: [
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080038 'ng-annotate',
Matteo Scandolod819c922016-12-02 14:06:14 -080039 'ts'
40 ]
41 },
42 {
43 test: /.html$/,
44 loaders: [
45 'html'
46 ]
47 }
48 ]
49 },
50 plugins: [
51 new webpack.optimize.OccurrenceOrderPlugin(),
52 new webpack.NoErrorsPlugin(),
53 new HtmlWebpackPlugin({
54 template: conf.path.src('index.html')
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080055 })
Matteo Scandolod819c922016-12-02 14:06:14 -080056 ],
57 postcss: () => [autoprefixer],
58 debug: true,
59 devtool: 'source-map',
60 output: {
61 path: path.join(process.cwd(), conf.paths.tmp),
62 filename: 'index.js'
63 },
64 resolve: {
65 extensions: [
66 '',
67 '.webpack.js',
68 '.web.js',
69 '.js',
70 '.ts'
71 ]
72 },
73 entry: `./${conf.path.src('index')}`,
74 ts: {
75 configFileName: 'tsconfig.json'
76 },
77 tslint: {
78 configuration: require('../tslint.json')
79 }
80};