Просмотр исходного кода

Configure handlerbars loader in webpack

Needed for the metrics app.
Alberto Fernández Capel 8 лет назад
Родитель
Сommit
cc530666ab
1 измененных файлов с 16 добавлено и 2 удалено
  1. 16 2
      services/web/webpack.config.js

+ 16 - 2
services/web/webpack.config.js

@@ -1,5 +1,6 @@
 const fs = require('fs')
 const path = require('path')
+const webpack = require('webpack')
 
 const MODULES_PATH = path.join(__dirname, '/modules')
 
@@ -60,10 +61,23 @@ module.exports = {
 					cacheDirectory: true
 				}
 			}]
+		},
+		{
+			test: /\.handlebars$/,
+			loader: "handlebars-loader",
+			options: {
+				compat: true,
+				knownHelpersOnly: false,
+				runtimePath: 'handlebars/runtime',
+			}
 		}]
 	},
-
+	resolve: {
+		alias: {
+			handlebars: 'handlebars/dist/handlebars.min.js',
+			jquery: path.join(__dirname, 'node_modules/jquery/dist/jquery'),
+		}
+	},
 	// TODO
 	// plugins: {}
 }
-