Skip to content

Commit

Permalink
add my .js, .json and .css to webpack pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasgwozdz committed Jan 3, 2024
1 parent 6ea824b commit 19ff76d
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 7 deletions.
4 changes: 2 additions & 2 deletions _includes/bibliography.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<link rel="stylesheet" href="/bibliography/bibliography.css" />
<link rel="stylesheet" href="dist/main.css" />
<div class="search-and-guide">
<div id="search">
<div style="width: 45%; margin: auto">
Expand Down Expand Up @@ -60,5 +60,5 @@ <h2 class="expand" id="authorLabel" onclick="toggleAuthorFilter()">
</div>
</div>

<script src="/bibliography/bibliography.js"></script>
<script src="dist/main.js"></script>

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},
"devDependencies": {
"bulma": "^0.9.4",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.6.0",
"mini-css-extract-plugin": "^2.5.3",
"sass": "^1.49.8",
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ window.onload = function () {

// Fetches data and initializes the application
function fetchDataAndInitialize() {
fetch("/bibliography/aksw.json")
fetch("dist/aksw.json")
.then(handleFetchResponse)
.then(initializeData)
.then(addEventListeners)
Expand Down Expand Up @@ -193,12 +193,12 @@ function jsonToBibtex(json) {
}

// Toggles the display of the year filter
function toggleYearFilter() {
window.toggleYearFilter = function() {
toggleFilterDisplay("yearFilter");
}

// Toggles the display of the author filter
function toggleAuthorFilter() {
window.toggleAuthorFilter = function() {
toggleFilterDisplay("authorFilter");
}

Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
import 'loading-attribute-polyfill';
import './mystyles.scss';
import './bibliography/bibliography.css';
import './bibliography/bibliography.js';
12 changes: 10 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const CopyWebpackPlugin = require('copy-webpack-plugin');

module.exports = {
mode: 'production', // development production
plugins: [new MiniCssExtractPlugin()],
plugins: [
new MiniCssExtractPlugin(),
new CopyWebpackPlugin({
patterns: [
{ from: 'src/bibliography/aksw.json', to: 'aksw.json' },
],
}),
],
output: {
path: __dirname + '/dist',
},
module: {
rules: [
{
test: /\.s[ac]ss$/i,
test: /\.(sa|sc|c)ss$/i, // This now includes .css files
use: [
// https://webpack.js.org/plugins/mini-css-extract-plugin/
MiniCssExtractPlugin.loader,
Expand Down

0 comments on commit 19ff76d

Please sign in to comment.