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

56 lines
1.3 KiB
JavaScript
Raw Normal View History

2018-10-18 10:26:25 -04:00
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',
2018-11-02 06:57:52 -04:00
entry: './templates/index.js',
2018-10-18 10:26:25 -04:00
output: {
filename: 'site.js',
path: path.resolve(__dirname, 'dist', 'public', 'assets'),
publicPath: '/assets'
2018-10-18 10:26:25 -04:00
},
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',
2018-11-02 06:57:52 -04:00
template: 'templates/layout.html.hbs',
2018-10-18 10:26:25 -04:00
}),
new text({
filename: 'site.css'
}),
new copy([
{
2018-11-02 06:57:52 -04:00
from: 'templates/*.hbs',
2018-10-18 10:26:25 -04:00
to: path.resolve(__dirname, 'dist', "templates"),
ignore: [ 'layout.html.hbs' ],
flatten: true
}
])
]
};