2018-10-10 15:54:27 -04:00
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
|
|
|
const path = require('path')
|
2021-06-21 14:14:29 -04:00
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
2018-10-10 15:54:27 -04:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
name: 'save-as-html',
|
|
|
|
entry: {
|
|
|
|
htmlExport: path.join(__dirname, 'public/js/htmlExport.js')
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [{
|
|
|
|
test: /\.css$/,
|
|
|
|
use: [MiniCssExtractPlugin.loader, 'css-loader']
|
2021-06-21 14:14:29 -04:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: 'url-loader'
|
|
|
|
}
|
|
|
|
]
|
2018-10-10 15:54:27 -04:00
|
|
|
}]
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
path: path.join(__dirname, 'public/build'),
|
2019-12-19 12:00:51 -05:00
|
|
|
publicPath: 'build/',
|
2018-10-10 15:54:27 -04:00
|
|
|
filename: '[name].js'
|
|
|
|
},
|
|
|
|
plugins: [
|
2021-06-21 14:14:29 -04:00
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
// Load a custom template (uses lodash templating)
|
|
|
|
template: 'public/views/htmlexport.ejs',
|
|
|
|
filename: 'htmlexport.html',
|
|
|
|
inject: false,
|
|
|
|
cache: false
|
|
|
|
}),
|
|
|
|
new MiniCssExtractPlugin({ filename: 'htmlexport.css' })
|
2018-10-10 15:54:27 -04:00
|
|
|
]
|
|
|
|
}
|