Skip to content

Commit 9e3876d

Browse files
committed
Docs: Introduce module example using webpack
1 parent f6893ee commit 9e3876d

File tree

7 files changed

+870
-1
lines changed

7 files changed

+870
-1
lines changed

examples/module/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bundle.js

examples/module/index.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<link rel="preconnect" href="https://fonts.googleapis.com">
6+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
7+
8+
<title>Cookie Consent Manager – module example</title>
9+
<meta name="viewport" content="width=device-width, initial-scale=1">
10+
11+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap">
12+
13+
<link rel="stylesheet" href="../../dist/LmcCookieConsentManager.min.css"><!-- You will load this from CDN instead -->
14+
15+
</head>
16+
<body>
17+
<h1>LMC Cookie Consent Manager</h1>
18+
<script defer src="./bundle.js"></script>
19+
</body>
20+
</html>

examples/module/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// eslint-disable-next-line import/no-unresolved
2+
import LmcCookieConsentManager from '@lmc-eu/cookie-consent-manager';
3+
4+
window.addEventListener('load', () => {
5+
LmcCookieConsentManager('example');
6+
});

examples/module/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@lmc-eu/cookie-consent-manager-exmaple-module",
3+
"version": "1.0.0",
4+
"license": "MIT",
5+
"devDependencies": {
6+
"webpack": "^5.63.0",
7+
"webpack-cli": "^4.9.1"
8+
},
9+
"dependencies": {
10+
"@lmc-eu/cookie-consent-manager": "^0.4.1"
11+
},
12+
"scripts": {
13+
"build": "webpack build --config ./webpack.config.js"
14+
}
15+
}

examples/module/webpack.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
entry: './index.js',
5+
output: {
6+
path: path.resolve(__dirname, './'),
7+
filename: 'bundle.js',
8+
},
9+
};

examples/module/yarn.lock

Lines changed: 819 additions & 0 deletions
Large diffs are not rendered by default.

examples/webpack-with-esm/bundle.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)