Skip to content
Snippets Groups Projects
Commit a20ea23a authored by Lars Bilke's avatar Lars Bilke
Browse files

[web] Refactored to use Hugo Asset Pipeline for css and js.

parent 56555ed6
No related branches found
No related tags found
No related merge requests found
Source diff could not be displayed: it is too large. Options to address this: view the blob.
{"Target":"main.min.f4c200a4aaf4b1b42ec6cbdba0f63336986ba68265219367a21d212697db7b25.css","MediaType":"text/css","Data":{"Integrity":"sha256-9MIApKr0sbQuxsvboPYzNphrpoJlIZNnoh0hJpfbeyU="}}
\ No newline at end of file
import styles from './styles.css'
import './js/osselector.js'
import './js/sitesearch.js'
import './js/fancybox.js'
// import './js/sharp.js'
// const images = require('../../content/features/*.png?{"outputs":["thumbnail"]}'); // one image
// Create thumbs for all images!
var context = require.context("../../content", true, /\.(gif|jpe?g|png|svg|tiff)(\?.*)?$/);
var obj = {};
context.keys().forEach(function (key) {
obj[key] = context(key);
});
var webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const path = require('path');
const sharp = require('sharp');
module.exports = {
mode: 'development',
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
},
module: {
rules: [
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{ loader: 'css-loader', options: { importLoaders: 1 } },
'postcss-loader'
]
})
},
{
test: /\.(gif|jpe?g|png|tiff)(\?.*)?$/,
use: [
{
loader: 'sharp-loader',
query: {
context: path.join(__dirname, 'content'),
name: '[path][name].[ext].[preset]',
cacheDirectory: true,
presets: {
thumbnail: {
width: 320,
height: 200,
quality: 70,
}
}
},
}
]
},
{
test: /\.(eot|svg|ttf|woff|woff2)$/,
use: [
{
loader: 'file-loader',
options: {}
}
]
}
]
},
plugins: [
new ExtractTextPlugin('styles.css'),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
'window.jQuery': 'jquery'
})
],
devtool: 'source-map'
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment