Skip to content
Snippets Groups Projects
Commit 6f9ff1cf authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire: Committed by Reiter, Christoph
Browse files

Merge branch 'master' of gitlab.tugraz.at:VPU/WebComponents/Notification

parent 877475c3
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
<html>
<head>
<meta charset="UTF-8">
<script type="module" id="vpu-notification-src" src="bundle.js"></script>
<script type="module" id="vpu-notification-src" src="vpu-notification-demo.js"></script>
</head>
<body>
......
{
"name": "vpu-notification",
"version": "1.0.0",
"main": "src/index.js",
"main": "src/vpu-notification.js",
"devDependencies": {
"karma": "^4.2.0",
"karma-chai": "^0.1.0",
......
......@@ -10,42 +10,23 @@ import url from "rollup-plugin-url";
import consts from 'rollup-plugin-consts';
import del from 'rollup-plugin-delete';
const pkg = require('./package.json');
const build = (typeof process.env.BUILD !== 'undefined') ? process.env.BUILD : 'local';
console.log("build: " + build);
let manualChunks = Object.keys(pkg.dependencies).reduce(function (acc, item) { acc[item] = [item]; return acc;}, {});
manualChunks = Object.keys(pkg.devDependencies).reduce(function (acc, item) { if (item.startsWith('vpu-')) acc[item] = [item]; return acc;}, manualChunks);
function getBuildInfo() {
const child_process = require('child_process');
const url = require('url');
let remote = child_process.execSync('git config --get remote.origin.url').toString().trim();
let commit = child_process.execSync('git rev-parse --short HEAD').toString().trim();
let parsed = url.parse(remote);
let newPath = parsed.path.slice(0, parsed.path.lastIndexOf('.'))
let newUrl = parsed.protocol + '//' + parsed.host + newPath + '/commit/' + commit;
return {
info: commit,
url: newUrl,
env: build
}
}
export default {
input: (build != 'test') ? 'src/demo.js' : 'test/**/*.js',
input: (build != 'test') ? ['src/vpu-notification.js', 'src/vpu-notification-demo.js'] : 'test/**/*.js',
output: {
file: 'dist/bundle.js',
format: 'esm'
dir: 'dist',
entryFileNames: '[name].js',
chunkFileNames: 'shared/[name].[hash].[format].js',
format: 'esm',
sourcemap: true
},
plugins: [
del({
targets: 'dist/*'
}),
multiEntry(),
(build == 'test') ? multiEntry() : false,
consts({
environment: build,
}),
......
import './vpu-notification';
import { send } from 'vpu-common/notification';
export { send };
......@@ -3,6 +3,9 @@ import {createUUID} from './utils'
import {css, html} from 'lit-element';
import VPULitElement from 'vpu-common/vpu-lit-element';
import * as commonUtils from 'vpu-common/utils';
import { send } from 'vpu-common/notification';
export { send };
/**
* Notification web component
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment