Skip to content

Commit

Permalink
Docs: Introduce module example using webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Dec 6, 2021
1 parent f6893ee commit 9e3876d
Show file tree
Hide file tree
Showing 7 changed files with 870 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/module/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bundle.js
20 changes: 20 additions & 0 deletions examples/module/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

<title>Cookie Consent Manager – module example</title>
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap">

<link rel="stylesheet" href="../../dist/LmcCookieConsentManager.min.css"><!-- You will load this from CDN instead -->

</head>
<body>
<h1>LMC Cookie Consent Manager</h1>
<script defer src="./bundle.js"></script>
</body>
</html>
6 changes: 6 additions & 0 deletions examples/module/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// eslint-disable-next-line import/no-unresolved
import LmcCookieConsentManager from '@lmc-eu/cookie-consent-manager';

window.addEventListener('load', () => {
LmcCookieConsentManager('example');
});
15 changes: 15 additions & 0 deletions examples/module/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@lmc-eu/cookie-consent-manager-exmaple-module",
"version": "1.0.0",
"license": "MIT",
"devDependencies": {
"webpack": "^5.63.0",
"webpack-cli": "^4.9.1"
},
"dependencies": {
"@lmc-eu/cookie-consent-manager": "^0.4.1"
},
"scripts": {
"build": "webpack build --config ./webpack.config.js"
}
}
9 changes: 9 additions & 0 deletions examples/module/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const path = require('path');

module.exports = {
entry: './index.js',
output: {
path: path.resolve(__dirname, './'),
filename: 'bundle.js',
},
};
819 changes: 819 additions & 0 deletions examples/module/yarn.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion examples/webpack-with-esm/bundle.js

This file was deleted.

0 comments on commit 9e3876d

Please sign in to comment.