1
0
Fork 0
mirror of https://gitlab.com/hagrid-keyserver/hagrid.git synced 2023-02-13 20:55:02 -05:00
hagrid-keyserver--hagrid/webpack.config.js
2018-11-02 11:58:43 +01:00

55 lines
1.3 KiB
JavaScript

const path = require('path');
const html = require('html-webpack-plugin');
const text = require('extract-text-webpack-plugin');
const copy = require('copy-webpack-plugin')
module.exports = {
mode: 'production',
entry: './templates/index.js',
output: {
filename: 'site.js',
path: path.resolve(__dirname, 'dist', 'public', 'assets'),
publicPath: '/assets'
},
module: {
rules: [
{
test:/\.(s*)css$/,
use: text.extract({
fallback: 'style-loader',
use: [
'css-loader',
'sass-loader',
{
loader: 'postcss-loader',
options: {
plugins: function () { // post css plugins, can be exported to postcss.config.js
return [
require('autoprefixer')
];
}
}
}
]
})
}
]
},
plugins: [
new html({
filename: '../../templates/layout.html.hbs',
template: 'templates/layout.html.hbs',
}),
new text({
filename: 'site.css'
}),
new copy([
{
from: 'templates/*.hbs',
to: path.resolve(__dirname, 'dist', "templates"),
ignore: [ 'layout.html.hbs' ],
flatten: true
}
])
]
};