blob: f7830cee973a7393eedc78d15de5b1515a6db188 [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: [
38 'ts'
39 ]
40 },
41 {
42 test: /.html$/,
43 loaders: [
44 'html'
45 ]
46 }
47 ]
48 },
49 plugins: [
50 new webpack.optimize.OccurrenceOrderPlugin(),
51 new webpack.NoErrorsPlugin(),
52 new HtmlWebpackPlugin({
53 template: conf.path.src('index.html')
54 }),
55 new webpack.ContextReplacementPlugin(
56 /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
57 conf.paths.src
58 )
59 ],
60 postcss: () => [autoprefixer],
61 debug: true,
62 devtool: 'source-map',
63 output: {
64 path: path.join(process.cwd(), conf.paths.tmp),
65 filename: 'index.js'
66 },
67 resolve: {
68 extensions: [
69 '',
70 '.webpack.js',
71 '.web.js',
72 '.js',
73 '.ts'
74 ]
75 },
76 entry: `./${conf.path.src('index')}`,
77 ts: {
78 configFileName: 'tsconfig.json'
79 },
80 tslint: {
81 configuration: require('../tslint.json')
82 }
83};