Mercurial > hg > ng2-query-ismi
annotate config/webpack.common.js @ 62:7787ca310644 webpack tip
update @angular to 4.4.5.
author | Robert Casties <casties@mpiwg-berlin.mpg.de> |
---|---|
date | Wed, 18 Oct 2017 17:46:41 +0200 |
parents | 7b9d616695d3 |
children |
rev | line source |
---|---|
60 | 1 var webpack = require('webpack'); |
2 var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
3 var ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
4 var helpers = require('./helpers'); | |
62
7787ca310644
update @angular to 4.4.5.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
60
diff
changeset
|
5 //var path = require('path') |
7787ca310644
update @angular to 4.4.5.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
60
diff
changeset
|
6 //var webpackLinkPlugin = require('webpack-link'); |
60 | 7 |
8 module.exports = { | |
9 entry: { | |
10 'polyfills': './src/polyfills.ts', | |
11 'vendor': './src/vendor.ts', | |
12 'app': './src/main.ts' | |
13 }, | |
14 | |
15 resolve: { | |
16 extensions: ['.ts', '.js'] | |
17 }, | |
18 | |
19 module: { | |
20 rules: [ | |
21 { | |
22 test: /\.ts$/, | |
23 loaders: [ | |
24 { | |
25 loader: 'awesome-typescript-loader', | |
26 options: { configFileName: helpers.root('src', 'tsconfig.json') } | |
27 } , 'angular2-template-loader' | |
28 ] | |
29 }, | |
30 { | |
31 test: /\.html$/, | |
32 loader: 'html-loader' | |
33 }, | |
34 { | |
35 test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/, | |
36 loader: 'file-loader?name=assets/[name].[hash].[ext]' | |
37 }, | |
38 { | |
39 test: /\.css$/, | |
40 exclude: helpers.root('src', 'app'), | |
41 loader: ExtractTextPlugin.extract({ fallbackLoader: 'style-loader', loader: 'css-loader?sourceMap' }) | |
42 }, | |
43 { | |
44 test: /\.css$/, | |
45 include: helpers.root('src', 'app'), | |
46 loader: 'raw-loader' | |
47 } | |
48 ] | |
49 }, | |
50 | |
51 plugins: [ | |
52 // Workaround for angular/angular#11580 | |
53 new webpack.ContextReplacementPlugin( | |
54 // The (\\|\/) piece accounts for path separators in *nix and Windows | |
55 /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/, | |
56 helpers.root('./src'), // location of your src | |
57 {} // a map of your routes | |
58 ), | |
59 | |
60 new webpack.optimize.CommonsChunkPlugin({ | |
61 name: ['app', 'vendor', 'polyfills'] | |
62 }), | |
63 | |
64 new HtmlWebpackPlugin({ | |
65 template: 'src/index.html' | |
66 }) | |
62
7787ca310644
update @angular to 4.4.5.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
60
diff
changeset
|
67 |
7787ca310644
update @angular to 4.4.5.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
60
diff
changeset
|
68 // new webpackLinkPlugin({ |
7787ca310644
update @angular to 4.4.5.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
60
diff
changeset
|
69 // localModule: path.resolve(__dirname, '../ng2-table') |
7787ca310644
update @angular to 4.4.5.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
60
diff
changeset
|
70 // }) |
60 | 71 ] |
72 }; |