- /**
- * Plugin: CompressionPlugin
- * Description: Prepares compressed versions of assets to serve
- * them with Content-Encoding
- *
- * See: https://github.com/webpack/compression-webpack-plugin
- */
- new CompressionPlugin({
- regExp: /\.css$|\.html$|\.js$|\.map$/,
- threshold: 2 * 1024
- })
-
- ],
-
- /**
- * Static analysis linter for TypeScript advanced options configuration
- * Description: An extensible linter for the TypeScript language.
- *
- * See: https://github.com/wbuchwalter/tslint-loader
- */
- tslint: {
- emitErrors: true,
- failOnHint: true,
- resourcePath: 'src'
- },
-
- /**
- * Html loader advanced options
- *
- * See: https://github.com/webpack/html-loader#advanced-options
- */
- // TODO: Need to workaround Angular 2's html syntax => #id [bind] (event) *ngFor
- htmlLoader: {
- minimize: true,
- removeAttributeQuotes: false,
- caseSensitive: true,
- customAttrSurround: [
- [/#/, /(?:)/],
- [/\*/, /(?:)/],
- [/\[?\(?/, /(?:)/]
+ new NormalModuleReplacementPlugin(
+ /angular2-hmr/,
+ helpers.root('config/modules/angular2-hmr-prod.js')
+ ),
+
+ /**
+ * Plugin: IgnorePlugin
+ * Description: Don’t generate modules for requests matching the provided RegExp.
+ *
+ * See: http://webpack.github.io/docs/list-of-plugins.html#ignoreplugin
+ */
+
+ // new IgnorePlugin(/angular2-hmr/),
+
+ /**
+ * Plugin: CompressionPlugin
+ * Description: Prepares compressed versions of assets to serve
+ * them with Content-Encoding
+ *
+ * See: https://github.com/webpack/compression-webpack-plugin
+ */
+ // install compression-webpack-plugin
+ // new CompressionPlugin({
+ // regExp: /\.css$|\.html$|\.js$|\.map$/,
+ // threshold: 2 * 1024
+ // })
+
+ /**
+ * Plugin LoaderOptionsPlugin (experimental)
+ *
+ * See: https://gist.github.com/sokra/27b24881210b56bbaff7
+ */
+ new LoaderOptionsPlugin({
+ debug: false,
+ options: {
+
+ /**
+ * Static analysis linter for TypeScript advanced options configuration
+ * Description: An extensible linter for the TypeScript language.
+ *
+ * See: https://github.com/wbuchwalter/tslint-loader
+ */
+ tslint: {
+ emitErrors: true,
+ failOnHint: true,
+ resourcePath: 'src'
+ },
+
+ /**
+ * Html loader advanced options
+ *
+ * See: https://github.com/webpack/html-loader#advanced-options
+ */
+ // TODO: Need to workaround Angular 2's html syntax => #id [bind] (event) *ngFor
+ htmlLoader: {
+ minimize: true,
+ removeAttributeQuotes: false,
+ caseSensitive: true,
+ customAttrSurround: [
+ [/#/, /(?:)/],
+ [/\*/, /(?:)/],
+ [/\[?\(?/, /(?:)/]
+ ],
+ customAttrAssign: [/\)?\]?=/]
+ },
+
+ // FIXME: Remove
+ // https://github.com/bholloway/resolve-url-loader/issues/36
+ // https://github.com/jtangelder/sass-loader/issues/289
+ context: __dirname,
+ output: {
+ path: helpers.root('dist')
+ }
+ }
+ })