server/apps/files_versions/webpack.js
Robin Appelman 3cce485fc8
use webpack to compile handlebars for files_versions
This removes the need to manually compile the templates every time they are changed

Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-04-08 09:16:07 +02:00

41 lines
730 B
JavaScript

const path = require('path');
module.exports = {
entry: path.join(__dirname, 'src', 'files_versions.js'),
output: {
path: path.resolve(__dirname, 'js'),
publicPath: '/js/',
filename: 'files_versions.js'
},
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
}
},
{
test: /\.handlebars$/,
loader: "handlebars-loader"
}
]
},
resolve: {
extensions: ['*', '.js']
}
};